Bug 8945 – Can't call static struct initializer or constructor without qualifier for templated inner struct

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-02T11:01:00Z
Last change time
2013-03-24T20:57:28Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2012-11-02T11:01:28Z
--- struct S // or `class`, or `union` { struct S0(T) { int i; } struct S1(T) { this(int){} } } void main() { auto cs01 = const S.S0!int(); // ok auto cs02 = const S.S0!int(1); // ok auto cs1 = const S.S1!int(1); // ok auto s01 = S.S0!int(); // Error: struct S0 does not overload () auto s02 = S.S0!int(1); // Error: struct S0 does not overload () auto s1 = S.S1!int(1); // Error: struct S1 does not overload () } ---
Comment #1 by verylonglogin.reg — 2012-11-02T11:04:45Z
An easy workaround: --- auto s01 = S.S0!int.init; auto s02 = cast(S.S0!int) 1; auto s1 = cast(S.S1!int) 1; ---
Comment #2 by k.hara.pg — 2012-11-02T21:04:09Z
Comment #3 by github-bugzilla — 2013-03-06T09:13:43Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/156606d44c49ae5bc32db390caee3942aef3e002 fix Issue 8945 - Can't call static struct initializer or constructor without qualifier for templated inner struct https://github.com/D-Programming-Language/dmd/commit/1819a3018b49e6e494338aec8ea95b38fb9c409e Merge pull request #1250 from 9rnsr/fix8945 Issue 8945 - Can't call static struct initializer or constructor without qualifier for templated inner struct
Comment #4 by github-bugzilla — 2013-03-24T20:57:28Z