July 13, 2004 mixins, delegates... | ||||
---|---|---|---|---|
| ||||
This code: //////////////////////////// void bar ( void delegate () dg ) { dg(); } template MCaller ( alias f ) { void caller ( int i ) { bar ( delegate { f(i); } ); } } class A { mixin MCaller!(foo); void foo (int i) {} } class B { mixin MCaller!(baz); void baz (int i) {} } //////////////////////////// Produces this output when compiling: test.d(5): function caller cannot access frame of function __anonymous test.d(7): delegate __anonymous cannot access frame of function caller test.d(7): delegate __anonymous cannot access frame of function caller However, if I leave only one of either A or B, it compiles perfectly fine. Tried with DMD 0.95 on WinXP Pro. ----------------------- Carlos Santander Bernal |
Copyright © 1999-2021 by the D Language Foundation