digitalmars.D.learn - Weird "nested function cannot be accessed" error
- Max Samukha (21/21) May 29 2016 This code fails to compile:
This code fails to compile: void bar(alias f)() { f(); } void foo(alias f)() { bar!f(); } void main() { void f()() { } foo!f(); } Error: function test.main.f!().f is a nested function and cannot be accessed from test.bar!(f).bar But non-template nested functions are accepted: void main() { void f() { } foo!f(); // ok } What's going on here?
May 29 2016