sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[ddc]: review uses of Nullability.legacy in compiler

Open sigmundch opened this issue 3 years ago • 0 comments

It appears we have a few uses of Nullability.legacy as the default nullability for some interface types we generate during compilation.

Should some of those to use the currentLibrary!.nonNullable nullability instead?

Examples:

  • async functions: https://github.com/dart-lang/sdk/blob/facfb4d9aa87285d4ea6159f96040e3ec00c5ac0/pkg/dev_compiler/lib/src/kernel/compiler.dart#L3489 and https://github.com/dart-lang/sdk/blob/facfb4d9aa87285d4ea6159f96040e3ec00c5ac0/pkg/dev_compiler/lib/src/kernel/compiler.dart#L3506
  • factory invocations https://github.com/dart-lang/sdk/blob/facfb4d9aa87285d4ea6159f96040e3ec00c5ac0/pkg/dev_compiler/lib/src/kernel/compiler.dart#L5911
  • maps: https://github.com/dart-lang/sdk/blob/facfb4d9aa87285d4ea6159f96040e3ec00c5ac0/pkg/dev_compiler/lib/src/kernel/compiler.dart#L5974
  • sets: https://github.com/dart-lang/sdk/blob/facfb4d9aa87285d4ea6159f96040e3ec00c5ac0/pkg/dev_compiler/lib/src/kernel/compiler.dart#L5985
  • list: https://github.com/dart-lang/sdk/blob/facfb4d9aa87285d4ea6159f96040e3ec00c5ac0/pkg/dev_compiler/lib/src/kernel/compiler.dart#L6266
  • set literals: https://github.com/dart-lang/sdk/blob/facfb4d9aa87285d4ea6159f96040e3ec00c5ac0/pkg/dev_compiler/lib/src/kernel/compiler.dart#L6286

sigmundch avatar Sep 19 '22 16:09 sigmundch