www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16022] New: dmd assertion failure due to misplaced comma

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

          Issue ID: 16022
           Summary: dmd assertion failure due to misplaced comma operator
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: mail skoppe.eu

I changed something in my code to:

    bool foo()
    {
        return (
            token.type == Type.Colon, // Typo: wanted logical operator instead
of comma
            token.type == Type.Comma);
    }

And I suddenly got this back from dmd:

    linkage = 0
    Assertion failed: (0), function visit, file tocsym.c, line 246.
    dmd failed with exit code -6.

In the function foo I wanted to type || instead of the comma. Regardless, it
shouldn't fail with an assertion.

--
May 13 2016