http://d.puremagic.com/issues/show_bug.cgi?id=7694



--- Comment #3 from Kenji Hara <k.hara...@gmail.com> 2012-03-23 22:50:19 PDT ---
(In reply to comment #0)
> As is the following gives assert on line 8 as expected, 
> uncomment bootstrap to get Internal error: e2ir.c 1251
> 
> template Instruction(int ir)
> {
>     void match(alias s, alias  m)(){ m.nextState(); }
> }
> 
> 
> struct T{
>     void nextState(){  assert(0); }
> /*    void bootstrap()
>     {
>     return Instruction!(0).match!(this, this)();
>     }*/
> }
> 
> T t;
> void main()
> {
> 
> //  t.bootstrap();
>   Instruction!(0).match!(t, t)();
> }

With my pull, this code doesn't report ice, but raises following errors:

test.d(11): Error: template instance match!(this,this) cannot use local 'this'
as parameter to non-global template match(alias s,alias m)
test.d(11): Error: template instance match!(this,this) cannot use local 'this'
as parameter to non-global template match(alias s,alias m)

But I think this is a little harsh error. The nested template (function) match
in module template Instruction really needs only one context, that is enclosing
'this' given as alias parameters m and n.

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

Reply via email to