[Issue 18429] alias this enum causes segmentation fault

2018-02-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18429

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 18429] alias this enum causes segmentation fault

2018-02-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18429

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/df08cb6c83ec29425343d734fb00b0d33f3fd92d
Fix Issue 18429 - alias this enum causes segmentation fault

https://github.com/dlang/dmd/commit/5cc4309525c7f36ebeb260dcadc90d263df4b1de
Merge pull request #7888 from RazvanN7/Issue_18429

Fix Issue 18429 - alias this enum causes segmentation fault
merged-on-behalf-of: Mike Franklin <jins...@users.noreply.github.com>

--


[Issue 18429] alias this enum causes segmentation fault

2018-02-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18429

RazvanN  changed:

   What|Removed |Added

 CC||razvan.nitu1...@gmail.com

--- Comment #1 from RazvanN  ---
(In reply to Ali Cehreli from comment #0)
> struct S {
> alias a this;
> enum a = 1;
> }
> 
> $ dmd deneme.d -c
> Segmentation fault
> 
> Interestingly, when the lines inside struct S are swapped then it compiles
> fine.
> 
> Ali

This happens with declarations for which the type must be deduced. Note that
replacing enum with auto results in segmentation fault (or assert error on my
machine - you probably do not have the latest version of dmd). That is due to
the fact that when semantic is performed an the alias this AST node, the type
of the enum variable is not known. Calling semantic on the symbol fixes the
issue.

PR: https://github.com/dlang/dmd/pull/7888

--