Skip to content

Should Never be explicitly declared in dart:core? #335

@stereotype441

Description

@stereotype441

It was decided in #262 that with NNBD, the bottom type should become first class (i.e. the user should be able to refer to it by name and use it as the type of variables and type parameters). In the draft specification, the type is called Never and is considered to be declared in dart:core.

Should there be an explicit class declaration for Never in sdk/lib/ (as there is for Null, FutureOr, and Function)? Or should it be implicitly declared by dart:core, like dynamic?

It would be good to have a decision about this up front, because it has a significant impact on the implementation, and we would rather not have to change horses in mid-stream. @bwilkerson and I believe that either choice has a similar implementation cost in the analyzer.

CC @kmillikin in case he wants to weigh in on the implementation cost in the front end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    nnbdNNBD related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions