[Issue 7169] [CTFE] Assertion failure with inner struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 5 22:53:16 PDT 2013


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



--- Comment #2 from Walter Bright <bugzilla at digitalmars.com> 2013-10-05 22:53:15 PDT ---
(In reply to comment #0)
> struct Struct(T){
>     T t;
> }
> 
> void func(T)(T t){
>     Struct!T s;
>     s.t = t;
> }
> 
> static assert({
>     struct InnerStruct{
>         void func(){}
>     }
>     func(InnerStruct());
>     return true;
> }());
> 
> void main(){}
> 
> 
> This code doesn't work.

It produces a correct error message:

test.d(6): Error: delegate test.__lambda4 is a nested function and cannot be
accessed from test.func!(InnerStruct).func

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


More information about the Digitalmars-d-bugs mailing list