Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error message for invalid enumerator with enumeration namespace #94

Open
ppaulweber opened this issue Apr 27, 2019 · 1 comment

Comments

@ppaulweber
Copy link
Contributor

Describe the bug

The usage of invalid enumerator names of a enumeration definition does not trigger an appropriate error message that an enumerator symbol name inside a enumeration does not exist, but instead a property violation error is triggered.
The following example.casm specification was used to trigger the bug:

CASM init test

enumeration Color = { Red, Green, Blue }

rule test =
    // enumerator 'Black' is not defined inside 'Color'
    assert( Color::Black = Color::Black )

To Reproduce

The following behavior occurs with the released casmi tool with version 0.3.0 and the following command: $ casmi example.casm

$ casmi example.casm
casmi: error: argument violates 'side effect free' property, @7{5f07}
bug.casm:7:13..7:40
    assert( Color::Black = Color::Black )
            ^-------------------------^

Expected behavior

The casmi tool shall report that the enumerator Black is an unknown symbol and not defined in enumeration Color:

$ casmi example.casm
casmi: error: enumerator 'Black' is not defined in the enumeration definition 'Color'
bug.casm:7:13..7:40
    assert( Color::Black = Color::Black ) 
            ^-------------------------^
@ppaulweber ppaulweber added this to the 0.4.0-diodorus milestone Apr 27, 2019
ppaulweber added a commit to casm-lang/libcasm-tc that referenced this issue Apr 28, 2019
@ppaulweber
Copy link
Contributor Author

Current status: branch created with regression test at TC, still WIP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant