sdk
sdk copied to clipboard
[ddc]: review uses of Nullability.legacy in compiler
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