[breaking change] Null safety changes #40686

308 views
Skip to first unread message

Franklin Yow

unread,
Feb 20, 2020, 8:14:55 PM2/20/20
to anno...@dartlang.org

This is a meta-issue summarizing breaking changes made as part of realizing the null safety feature.

We are planning on landing these breaking changes fairly soon, and this in advance of the full null safety feature to ensure that we have sufficient time to uncover any unanticipated consequences.


Please comment on the issues list below  if you expect these changes  to cause severe problems for your code.


Language

  • type system
    • #40633: Types objects will now be normalized
    • #40633: Subtyping of type bounds in function types will switch from using structural subtyping to use mutual subtyping.
    • #40675: Type inference for local variables will not use promoted type variables.

Core libraries

  • dart:core

    • #40674: The RuneIterator class has some members which return null in the state where the iterator has no "current" element; they will now return -1 or an empty string
    • #40678: The String.fromEnvironment and int.fromEnvironment const constructors will have a non-null defaultValue default value.
    • #40317: We will make the platform TypeError class not extend/implement the AssertionError class.
      That will also make it not inherit the message getter.
  • dart:async:

    • #40681: The runZoned method will now not catch synchronously thrown errors even when given an error handler.
    • #40676: The StreamSubscription.cancel method's return type is changed to Future<void>.
    • #40683: We disallow throwing nullable values entirely, and methods which accept thrown objects requires non-null arguments. This includes methods accepting async errors.
    • #40130: We will replace a null stack trace supplied by users with a default stack trace.
  • dart:io:

    • #40483: The Process class will throw specific exceptions rather than throwing null
    • #40702: Destroyed/Upgraded Sockets now throw when accessing socket options
    • #40706: Provide epoch timestamps in the FileStat notFound object
    • #40709: HeaderValue parses invalid parameters as empty string instead of null


Franklin Yow | Program Manager | fran...@google.com | 206-531-1401

Reply all
Reply to author
Forward
0 new messages