Skip to content

Type unsafety of ?? #465

Closed
Closed
@duzenko

Description

@duzenko

Consider the following code

    num n = 1;
    String s = n ?? List();

It gives an obvious runtime error.
I'm not so much interested in why it's considered a valid syntax as in getting the analyzer report this at compile time. I have bumped into this a few times too many.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions