https://issues.dlang.org/show_bug.cgi?id=18289
Issue ID: 18289
Summary: static function and access frame
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
According to the discussion here:
https://forum.dlang.org/thread/[email protected]
the following code should compile, but it does not.
void main() // line 1
{
auto s = S();
auto t = T!s(); // line 4
t.fun;
}
struct S { void fun(){} }
struct T(alias s){ static fun() { s.fun; } } // line 8
The error is:
source/app.d(8,35): Error: static function app.main.T!(s).T.fun cannot access
frame of function D main
source/app.d(4,14): Error: template instance app.main.T!(s) error instantiating
--