Skip to content

co19/LanguageFeatures/Constructor-tear-offs tests are incorrect without sound null safety #1161

Closed
@alexmarkov

Description

@alexmarkov

Several co19/LanguageFeatures/Constructor-tear-offs tests are valid with sound null safety, but incorrect if running in unsound mode. These tests should be either fixed to work in both modes or updated to require sound null safety mode using

// Requirements=nnbd-strong
  • co19/LanguageFeatures/Constructor-tear-offs/tearing_off_from_typedef_A02_t05 expects exception when null is passed as an int argument:

Expect.throws(() { v(10, null as dynamic); });

  • co19/LanguageFeatures/Constructor-tear-offs/tearing_off_from_typedef_A03_t03 expects exception when null is passed as a String argument:

Expect.throws(() { v(2, null as dynamic); });

  • co19/LanguageFeatures/Constructor-tear-offs/function_tearoffs_A01_t02 expects exception when null is passed as an int argument (2 times, d3 == null):

Expect.throws(() { idInt(d3); });
Expect.throws(() { idInt(null as dynamic); });

  • co19/LanguageFeatures/Constructor-tear-offs/named_constructor_A04_t20

Expect.throws(() { v(i: null as dynamic); });

  • co19/LanguageFeatures/Constructor-tear-offs/tearing_off_from_typedef_A03_t06

Expect.throws(() { v1(7, null as dynamic); });

  • co19/LanguageFeatures/Constructor-tear-offs/named_constructor_A04_t19

Expect.throws(() { v(i: null as dynamic); });

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