www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14500] New: AliasDeclaration::semantic corrupts Type


          Issue ID: 14500
           Summary: AliasDeclaration::semantic corrupts Type
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: goejendaagh zonnet.nl

The following code
    alias ImGuiCol = int;
    alias Func  = const char* function(ImGuiCol);

results in a call to AliasDeclaration::semantic for Func, where the declaration
is resolved and stored into AliasDeclaration::type as "const( char*
function(int) )". However, type is now partly "corrupt"/unresolved:
->toChar() = "const( char* function(int) )", but
->mutableOf()->toChar() = "const( char* function(ImGuiCol) )"

LDC will crash because of this. See LDC Github issue #893 [1].

[1] https://github.com/ldc-developers/ldc/issues/893

Apr 25 2015