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

Assert in initializers experiment #27141

Closed
3 tasks done
lrhn opened this issue Aug 24, 2016 · 15 comments
Closed
3 tasks done

Assert in initializers experiment #27141

lrhn opened this issue Aug 24, 2016 · 15 comments
Assignees
Labels
area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...).

Comments

@lrhn
Copy link
Member

lrhn commented Aug 24, 2016

We are experimenting with allowing asserts in initializer lists.
See the design document.

For this experiment, we need (behind the flag --assert-initializer):

That should be sufficient for the people behind issue #24841 to test out the implementation and see if it covers their needs.

@lrhn lrhn added the area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). label Aug 24, 2016
@lrhn lrhn self-assigned this Aug 24, 2016
@a14n
Copy link
Contributor

a14n commented Aug 24, 2016

Could the design document be made public?

@lrhn
Copy link
Member Author

lrhn commented Aug 24, 2016

My docs-fu is too weak, so I converted the design document it to a gist.

@a14n
Copy link
Contributor

a14n commented Aug 24, 2016

thanks

@bwilkerson
Copy link
Member

The doc defines the assert statement as being assert(expression), but the analyzer accepts an optional second argument. Is the omission an oversight, or should asserts in constructor initializers not allow a message?

@lrhn
Copy link
Member Author

lrhn commented Aug 29, 2016

We are going to add the second "argument" to assert, so keep it for now.

@munificent munificent added this to the 1.50 milestone Oct 11, 2016
@dgrove
Copy link
Contributor

dgrove commented Oct 20, 2016

@lrhn can you please provide an update?

@dgrove
Copy link
Contributor

dgrove commented Nov 11, 2016

@lrhn can you provide an update?

@jmesserly
Copy link

FYI DDC issue #27809

@munificent
Copy link
Member

This is not a 1.50 feature, so kicking out of the milestone. (I think we accidentally got it confused with assert messages, which are in 1.50).

@munificent munificent removed this from the 1.50 milestone Dec 12, 2016
@sethladd
Copy link
Contributor

This is done, right? flutter has this turned on now.

@munificent munificent changed the title Assert in initializers experiment. Assert in initializers experiment Apr 21, 2017
@munificent
Copy link
Member

I'm not sure if this tracking issue is for the experiment or the feature. If the former, I guess it's closable? If the latter, no, because we haven't decided if we want to commit to it, remove the flag, etc.

@jmesserly
Copy link

oh gosh, yeah. Also DDC doesn't implement it yet, which I think nowadays we want for new language features? (it's not hard to implement btw)

@lrhn
Copy link
Member Author

lrhn commented Apr 24, 2017

This is a Flutter-only experiment (which is why it's VM+analyzer only so far, and should perhaps also include the formatter). That is all it is at this point. There is no decision to make it a language feature yet, it's not implemented by DDC or dart2js, and unless the experiment is a success, it will eventually be removed again.
The exact conditions for considering it a success isn't set in stone, but it should add non-negligible value for the Flutter developers. If it isn't, then it's just not worth its own weight.

@munificent munificent changed the title Assert in initializers experiment Assert in initializers Oct 3, 2017
@munificent munificent changed the title Assert in initializers Assert in initializers experiment Oct 3, 2017
@munificent
Copy link
Member

The experiment has graduated to a feature. Closing out this bug in favor of #30968.

@sethladd
Copy link
Contributor

sethladd commented Oct 3, 2017

Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...).
Projects
None yet
Development

No branches or pull requests

8 participants