[Issue 693] 'this' can't be used as an alias parameter for a mixin

2013-01-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=693



--- Comment #6 from github-bugzi...@puremagic.com 2013-01-21 00:20:12 PST ---
Commits pushed to master at
https://github.com/D-Programming-Language/d-programming-language.org

https://github.com/D-Programming-Language/d-programming-language.org/commit/9e84dccf6286dd7e718f247bf1a623cd50f68553
fix Issue 693 - 'this' can't be used as an alias parameter for a mixin

https://github.com/D-Programming-Language/d-programming-language.org/commit/0cf09c6b06c13345024772864f6654002904244c
Merge pull request #239 from 9rnsr/fix693

Issue 693 - 'this' can't be used as an alias parameter for a mixin

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 693] 'this' can't be used as an alias parameter for a mixin

2011-07-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=693


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #5 from Walter Bright bugzi...@digitalmars.com 2011-07-01 
00:31:09 PDT ---
https://github.com/D-Programming-Language/dmd/commit/5a1f396e915e083ce30c5f09f4e1ef1a9e704fda

https://github.com/D-Programming-Language/dmd/commit/c9e26681a834beb6b211f41234163707453f4ff1

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 693] 'this' can't be used as an alias parameter for a mixin

2011-05-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=693


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 CC||zan77...@nifty.com


--- Comment #4 from Kenji Hara k.hara...@gmail.com 2011-05-07 06:20:37 PDT ---
*** Issue 4799 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 693] 'this' can't be used as an alias parameter for a mixin

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=693


Simen Kjaeraas simen.kja...@gmail.com changed:

   What|Removed |Added

 CC||simen.kja...@gmail.com


--- Comment #2 from Simen Kjaeraas simen.kja...@gmail.com 2011-04-12 01:57:39 
PDT ---
This also a problem for non-mixin templates:

struct MyCallable {
int opCall( int n ) {
return n;
}

auto mapthis( int[] arr ) {
return map!this( arr );
}
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 693] 'this' can't be used as an alias parameter for a mixin

2011-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=693



--- Comment #3 from Simen Kjaeraas simen.kja...@gmail.com 2011-04-12 03:01:10 
PDT ---
Thinking about this some more, fixing this bug could lead to safer array
indexing for one, through a limited system of dependent types:

struct SafeArray( T ) {
T[] data;

struct Index( alias arr ) {
size_t idx;
// Add safety checks, overflow handling, etc.
}

Index!this makeIndex( size_t n ) {
typeof( return ) result;
result.idx = n;
return result;
}

T opIndex( Index!this idx ) {
return data[idx.idx];
}
}

unittest {
SafeArray!int arr;
arr.data = [1,2,3,4,5,6,7,8,9,0];
auto idx = arr.makeIndex( 3 );
writeln( arr[idx] ); // Completely safe indexing of array, enforced by type
system.
}

There may be a problem in that compiler considers 'this' a local parameter to a
non-global template, which is currently illegal. Not sure how much of a problem
this might be in practice.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 693] 'this' can't be used as an alias parameter for a mixin

2010-11-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=693


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||and...@metalanguage.com
 AssignedTo|nob...@puremagic.com|bugzi...@digitalmars.com


--- Comment #1 from Andrei Alexandrescu and...@metalanguage.com 2010-11-26 
13:33:57 PST ---
Bug present in 1.065 and 2.050 with different error messages. 1.065:

test.d(14): Error: mixin printer_mix!(this) does not match template declaration
printer_mix(alias T)

2.050:

test.d(14): Error: expression this is not a valid template value argument

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---