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

Bug with record definitions #209

Open
Hibou57 opened this issue Jul 24, 2018 · 3 comments
Open

Bug with record definitions #209

Hibou57 opened this issue Jul 24, 2018 · 3 comments

Comments

@Hibou57
Copy link
Contributor

Hibou57 commented Jul 24, 2018

While testing, I tried this:

    typedef t = @{0x1=int, 02=int, 3=int, a=int}
    static val v: t
    val x = v.1

The first line triggers no error, suggesting natural numbers as record member names may be expressed in any base, although the syntax requires the selectors to be expressed with the decimal notation (it’s a special lexical unit).

But I get an error on the third line: “the record-type […] is expected to contain the label [int] but it does not.”

If for the third line I do this instead:

    val x = v.0

… then there is no more error. It seems 0x1 is misinterpreted as 0.

@githwxi
Copy link
Owner

githwxi commented Jul 25, 2018

I think '0x1' is parsed using the function 'atoi'. I will revisit the issue later.

@Hibou57
Copy link
Contributor Author

Hibou57 commented Jul 26, 2018

In the syntax guide, I wrote the label must use decimal notation. If this error is there, I believe this means in practice it always uses decimal else someone would have already noticed the issue.

@githwxi
Copy link
Owner

githwxi commented Jul 26, 2018

Thanks!

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

No branches or pull requests

2 participants