https://issues.dlang.org/show_bug.cgi?id=18429

RazvanN <razvan.nitu1...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1...@gmail.com

--- Comment #1 from RazvanN <razvan.nitu1...@gmail.com> ---
(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

--

Reply via email to