-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[VM] Parameterized map literal used as a statement doesn't cause an error #3777
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
Comments
This comment was originally written by @mhausner Can you please reference the relevant spec portion? From what I remember, the intent was to break the ambiguity of a { at the beginning of a statement by specifying it to be a block, never a map literal. But a map literal with type arguments should be fine at the beginning of a statement. |
This comment was originally written by [email protected] 11.2 Expression Statements |
This comment was originally written by @mhausner Thank you. I just spoke to Gilad. He agrees that this should only apply to map literals that start with a curly brace. That is, a map literal with type arguments is ok. He will update the spec accordingly. (The main issue this restriction solves is to disambiguate between map literal and beginning of a block, both of which start with a { token. ) cc @gbracha. |
Relevant spec snippet in 0.11 An expression statement consists of an expression other than a non-constant map literal that has no explicit type arguments. |
This comment was originally written by @mhausner Thanks Gilad. This makes the bug "invalid". I'll mark it as "fixed" since we fixed the spec instead of the compiler :) Added Area-Language, Fixed labels. |
This comment was originally written by [email protected] fix the last sentence of that chapter too, please |
This issue was originally filed by [email protected]
What steps will reproduce the problem?
Simplest example:
main() {
<Map>{};
}
What is the expected output? What do you see instead?
Expecting a compile-time error per spec, not seeing one.
What version of the product are you using? On what operating system?
VM build r8882
The text was updated successfully, but these errors were encountered: