Skip to content

Assert in initializers experiment #27141

Closed

Description

@lrhn

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.

Activity

  1. added
    area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).
    on Aug 24, 2016
  2. self-assigned this
    on Aug 24, 2016
  3. a14n commented on Aug 24, 2016

    @a14n
    Contributor

    Could the design document be made public?

  4. lrhn commented on Aug 24, 2016

    @lrhn
    MemberAuthor

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

  5. a14n commented on Aug 24, 2016

    @a14n
    Contributor

    thanks

  6. bwilkerson commented on Aug 24, 2016

    @bwilkerson
    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?

  7. lrhn commented on Aug 29, 2016

    @lrhn
    MemberAuthor

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

  8. added this to the 1.50 milestone on Oct 11, 2016
  9. dgrove commented on Oct 20, 2016

    @dgrove
    Contributor

    @lrhn can you please provide an update?

  10. dgrove commented on Nov 11, 2016

    @dgrove
    Contributor

    @lrhn can you provide an update?

  11. jmesserly commented on Nov 11, 2016

    @jmesserly

    FYI DDC issue #27809

  12. munificent commented on Dec 12, 2016

    @munificent
    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).

  13. removed this from the 1.50 milestone on Dec 12, 2016
  14. sethladd commented on Apr 20, 2017

    @sethladd
    Contributor

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

  15. changed the title [-]Assert in initializers experiment.[/-] [+]Assert in initializers experiment[/+] on Apr 21, 2017
  16. munificent commented on Apr 21, 2017

    @munificent
    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.

  17. jmesserly commented on Apr 21, 2017

    @jmesserly

    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)

  18. lrhn commented on Apr 24, 2017

    @lrhn
    MemberAuthor

    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.

  19. changed the title [-]Assert in initializers experiment[/-] [+]Assert in initializers[/+] on Oct 3, 2017
  20. changed the title [-]Assert in initializers[/-] [+]Assert in initializers experiment[/+] on Oct 3, 2017
  21. munificent commented on Oct 3, 2017

    @munificent
    Member

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

  22. sethladd commented on Oct 3, 2017

    @sethladd
    Contributor

    Thanks for the help!

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

Metadata

Metadata

Assignees

Labels

area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions