[Issue 17222] New: assert in compiler caused by opDispatch

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Feb 24 10:17:34 PST 2017


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

          Issue ID: 17222
           Summary: assert in compiler caused by opDispatch
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: john.loughran.colvin at gmail.com

Dustmite reduced from a slightly modified phobos, testing with a debug build of
dmd git HEAD:

template AliasSeq() { }

template Proxy(alias a)
{
    template opDispatch(string name)
    {
        static if (__traits(isTemplate, mixin("a."~name)))
            template opDispatch(T ...)
            {
                alias opDispatch = AliasSeq!(mixin("a."~name~"!(T)"));
            }
    }
}

unittest
{
    class Foo
    {
        T ifti1(T)(T) { }
    }
    class Hoge
    {
        Foo foo;
        mixin Proxy!foo;
    }

    Hoge.ifti1;
}

$ dmd -unittest std/typecons.d
core.exception.AssertError at dinterpret.d(714): Assertion failure
----------------
??:? _d_assert [0x717377]
??:? void ddmd.dinterpret.__assert(int) [0x54cf7e]
??:? _Z13ctfeInterpretP10Expression [0x53b395]
??:? _ZN10Expression13ctfeInterpretEv [0x581288]
??:? _ZN16TemplateInstance14semanticTiargsE3LocP5ScopeP5ArrayIP10RootObjectEi
[0x57188b]
??:? _ZN16TemplateInstance14semanticTiargsEP5Scope [0x571c8d]
??:? _ZN16TemplateInstance8semanticEP5ScopeP5ArrayIP10ExpressionE [0x56f0f0]
??:? _ZN16TemplateInstance8semanticEP5Scope [0x56fedf]
??:? _ZN12TypeInstance7resolveE3LocP5ScopePP10ExpressionPP4TypePP7Dsymbolb
[0x5eab95]
??:? _ZN12TypeInstance9toDsymbolEP5Scope [0x5ead85]
??:? _ZN16AliasDeclaration13aliasSemanticEP5Scope [0x530274]
??:? _ZN16AliasDeclaration8semanticEP5Scope [0x530049]
??:? _ZN16TemplateInstance13expandMembersEP5Scope [0x5739c1]
??:? _ZN16TemplateInstance16tryExpandMembersEP5Scope [0x573a36]
??:? _ZN16TemplateInstance8semanticEP5ScopeP5ArrayIP10ExpressionE [0x56f7c7]
??:? int ddmd.dtemplate.functionResolve(ddmd.declaration.Match*,
ddmd.dsymbol.Dsymbol, ddmd.globals.Loc, ddmd.dscope.Scope*,
ddmd.root.array.Array!(ddmd.root.rootobject.RootObject).Array*,
ddmd.mtype.Type,
ddmd.root.array.Array!(ddmd.expression.Expression).Array*).applyTemplate(ddmd.dtemplate.TemplateDeclaration)
[0x5676df]
??:? int ddmd.dtemplate.functionResolve(ddmd.declaration.Match*,
ddmd.dsymbol.Dsymbol, ddmd.globals.Loc, ddmd.dscope.Scope*,
ddmd.root.array.Array!(ddmd.root.rootobject.RootObject).Array*,
ddmd.mtype.Type,
ddmd.root.array.Array!(ddmd.expression.Expression).Array*).__lambda10(ddmd.dsymbol.Dsymbol)
[0x5681aa]
??:? int ddmd.func.overloadApply(ddmd.dsymbol.Dsymbol, scope int
delegate(ddmd.dsymbol.Dsymbol)) [0x5b0bbf]
??:? void ddmd.dtemplate.functionResolve(ddmd.declaration.Match*,
ddmd.dsymbol.Dsymbol, ddmd.globals.Loc, ddmd.dscope.Scope*,
ddmd.root.array.Array!(ddmd.root.rootobject.RootObject).Array*,
ddmd.mtype.Type, ddmd.root.array.Array!(ddmd.expression.Expression).Array*)
[0x566d69]
??:?
_Z15resolveFuncCall3LocP5ScopeP7DsymbolP5ArrayIP10RootObjectEP4TypePS4_IP10ExpressionEi
[0x5b0e94]
??:? _Z18resolvePropertiesXP5ScopeP10ExpressionS2_ [0x57a0ac]
??:? _Z17resolvePropertiesP5ScopeP10Expression [0x57a4de]
??:? _ZN24StatementSemanticVisitor5visitEP12ExpStatement [0x61ea81]
??:? _ZN12ExpStatement6acceptEP7Visitor [0x6132b9]
??:? ddmd.statement.Statement
ddmd.statementsem.semantic(ddmd.statement.Statement, ddmd.dscope.Scope*)
[0x62c242]
??:? _ZN24StatementSemanticVisitor5visitEP17CompoundStatement [0x61ed05]
??:? _ZN17CompoundStatement6acceptEP7Visitor [0x613a31]
??:? ddmd.statement.Statement
ddmd.statementsem.semantic(ddmd.statement.Statement, ddmd.dscope.Scope*)
[0x62c242]
??:? _ZN15FuncDeclaration9semantic3EP5Scope [0x5aa12f]
??:? _ZN6Module9semantic3EP5Scope [0x552781]
??:? int ddmd.mars.tryMain(ulong, const(char)**) [0x5d9a2f]
??:? _Dmain [0x5da6f6]
??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0x7190be]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).tryExec(scope void delegate()) [0x719004]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).runAll() [0x71907a]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
function(char[][])*).tryExec(scope void delegate()) [0x719004]
??:? _d_run_main [0x718f7e]
??:? main [0x5dae97]
??:? __libc_start_main [0xe3f0c290]

--


More information about the Digitalmars-d-bugs mailing list