[Issue 18974] New: ICE with mixin templates, inheritance and overloading

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 12 15:23:00 UTC 2018


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

          Issue ID: 18974
           Summary: ICE with mixin templates, inheritance and overloading
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: pro.mathias.lang at gmail.com

This kills DMD:
```
class Expression {}
class Statement : Expression {}

private template AssertFalse (T, Ret)
{
    Ret visit (const T node)
    {
        assert(0, T.stringof);
    }
}

class AssertSemanticVisitor (Node)
{
    mixin AssertFalse!(Statement, void) A;
    mixin AssertFalse!(Expression, void) B;
}

class ExpressionVisitor : AssertSemanticVisitor!(void)
{
    public override void visit (Expression) { assert(0); }
}
```

A debug build shows:
```
---
ERROR: This is a compiler bug.
Please report it via https://issues.dlang.org/enter_bug.cgi
with, preferably, a reduced, reproducible example and the information below.
DustMite (https://github.com/CyberShadow/DustMite/wiki) can help with the
reduction.
---
DMD v2.080.1-317-gda13edb77
predefs   DigitalMars Posix linux ELFv1 LittleEndian D_Version2 all D_SIMD
D_InlineAsm_X86_64 X86_64 CRuntime_Glibc D_LP64 D_PIC assert D_HardFloatbinary 
  ../dmd/generated/linux/release/64/dmd
version   v2.080.1-317-gda13edb77
config    ../dmd/generated/linux/release/64/dmd.conf
DFLAGS    -I../dmd/generated/linux/release/64/../../../../../druntime/import
-I../dmd/generated/linux/release/64/../../../../../phobos
-L-L../dmd/generated/linux/release/64/../../../../../phobos/generated/linux/release/64
-L--export-dynamic -fPIC
---
core.exception.AssertError at dmd/dsymbolsem.d(3453): Assertion failure
----------------
??:? _d_assertp [0xe754a7c9]
??:? _ZN22DsymbolSemanticVisitor23funcDeclarationSemanticEP15FuncDeclaration
[0xe7371bde]
??:? _ZN22DsymbolSemanticVisitor5visitEP15FuncDeclaration [0xe73722e0]
??:? _ZN15FuncDeclaration6acceptEP7Visitor [0xe73c513d]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0xe736868c]
??:? _ZN22DsymbolSemanticVisitor14attribSemanticEP17AttribDeclaration
[0xe736c3e6]
??:? _ZN22DsymbolSemanticVisitor5visitEP17AttribDeclaration [0xe736c448]
??:? _ZN16ParseTimeVisitorI10ASTCodegenE5visitEP15ProtDeclaration [0xe7448d82]
??:? _ZN15ProtDeclaration6acceptEP7Visitor [0xe730b095]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0xe736868c]
??:? _ZN22DsymbolSemanticVisitor5visitEP16ClassDeclaration [0xe7375e4c]
??:? _ZN16ClassDeclaration6acceptEP7Visitor [0xe7335e95]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0xe736868c]
??:? _ZN22DsymbolSemanticVisitor5visitEP6Module [0xe736d779]
??:? _ZN6Module6acceptEP7Visitor [0xe7357e09]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0xe736868c]
??:? int dmd.mars.tryMain(ulong, const(char)**) [0xe73fc19b]
??:? _Dmain [0xe73fd582]
```

--


More information about the Digitalmars-d-bugs mailing list