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

Generalize assert syntax in specification #26866

Closed
eernstg opened this issue Jul 12, 2016 · 6 comments
Closed

Generalize assert syntax in specification #26866

eernstg opened this issue Jul 12, 2016 · 6 comments
Labels
area-specification (deprecated) Deprecated: use area-language and a language- label.

Comments

@eernstg
Copy link
Member

eernstg commented Jul 12, 2016

With reference to #17682 for background, the language specification should be adjusted such that it uses the grammar rule

assertStatement: assert '(' expression ')' ';'

rather than the current one which uses conditionalExpression. The wording of the paragraph starting with 'The conditional expression e ..' in section 17.17 should be adjusted accordingly.

The language team analysis of this issue is available at https://gist.github.com/eernstg/50a327addd96035d5393a507c0ea2d9a.

@eernstg eernstg added the area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). label Jul 12, 2016
@bwilkerson
Copy link
Member

Should we also update the specification to reflect the optional message that I believe is already supported by all of the platforms?

@floitschG
Copy link
Contributor

Let's do this independently, but yes.

@lrhn
Copy link
Member

lrhn commented Jul 13, 2016

Is the optional message supported anywhere? I don't think we ever agreed on a design.

@bwilkerson
Copy link
Member

Analyzer supports an optional message (see #24217). According to #24213 it is also supported in dart2js and the formatter (though that issue was never updated to reflect that analyzer supports it). The discussion was around whether to require the second argument to be a String or whether to allow any object and use toString() to convert it to a string.

@lrhn
Copy link
Member

lrhn commented Jul 13, 2016

... or not convert it at all, and keep it as-is in the AssertionError object.

lrhn added a commit that referenced this issue Aug 15, 2016
@munificent munificent added area-specification (deprecated) Deprecated: use area-language and a language- label. and removed area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Dec 13, 2016
@munificent
Copy link
Member

Closing this because the commit message says it's fixed.

GitHub's "auto-close" looks for certain strings like "Fixes #...", but "fixes issue #..." isn't one of them. :)

@munificent munificent changed the title Generalize assert syntax Generalize assert syntax in specification Dec 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-specification (deprecated) Deprecated: use area-language and a language- label.
Projects
None yet
Development

No branches or pull requests

5 participants