Skip to content

LanguageFeatures/Patterns/object_A01_t05 #1744

@alexmarkov

Description

@alexmarkov

This test doesn't account for running without sound null safety (in weak mode):

Expect.throws(() {
var Square(areaAsNull: d1 as double) = Square(2);

From the spec:

If the runtime type of v is not a subtype of the cast type of p then throw a runtime error.

Without sound null safety Null is a bottom type (subtype of all types), so cast pattern should not throw.

Metadata

Metadata

Assignees

Labels

bad-testReport tests in need of updates. When closed, the tests should be considered good

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions