Skip to content

ShortCircuitOperators_A03_t12 is wrong #494

@athomas

Description

@athomas

ShortCircuitOperators_A03_t12 expects failures for things that don't fail:

const String s1 = "" ?? 124;

Where "" ?? 124 is an expression of type Object which get implicitly cast to String. The cast succeeds because the expression evaluates to "".

In NNBD, the implicit cast doesn't happen, so the error occurs but just because the type of the expression is wrong.

So the test doesn't test what it claims to test and what it claims to test is not something that needs testing.

https://github.com/dart-lang/co19/blob/pre-nnbd/LanguageFeatures/Constant-update-2018/ShortCircuitOperators_A03_t12.dart#L21

Metadata

Metadata

Assignees

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