[Issue 14500] New: AliasDeclaration::semantic corrupts Type

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Apr 25 08:36:31 PDT 2015


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

          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 at puremagic.com
          Reporter: goejendaagh at 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

--


More information about the Digitalmars-d-bugs mailing list