-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.toolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
covariant usage has caused subtle null safety bugs when the subtype is nonnull. Example:
flutter/packages/flutter_tools/lib/src/device.dart
Lines 585 to 588 in e4a80b4
| Future<bool> stopApp( | |
| covariant ApplicationPackage? app, { | |
| String? userIdentifier, | |
| }); |
flutter/packages/flutter_tools/lib/src/ios/simulators.dart
Lines 535 to 537 in e4a80b4
| Future<bool> stopApp( | |
| ApplicationPackage app, { | |
| String? userIdentifier, |
When null is passed into stopApp, but the override doesn't handle a null ApplicationPackage it caused runtime crash:
stderr: [ +7 ms] NoSuchMethodError: The getter 'id' was called on null.
stderr: Receiver: null
stderr: Tried calling: id
Audit covariant usage and remove where possible.
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.toolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.