https://issues.dlang.org/show_bug.cgi?id=13850
Max Samukha <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|WORKSFORME |--- --- Comment #5 from Max Samukha <[email protected]> --- (In reply to Salih Dincer from comment #4) > You are right, because there is alias! I am not sure what you mean exactly, but functions passed by alias are correctly rejected if they are used in a wrong context. Consider: mixin template Template(void function() func1, alias func2) { static void foo() { func1(); // UB // func2(); // This fails to compile } }; class SomeClass { int x; mixin Template!(&func23); void func23() { x = 1; } } void main() { SomeClass a = new SomeClass; a.foo(); assert(a.x == 1); // Fails } I am reopening this. Local function types have been an embarrassment for decades and should be fixed. --
