From ca963a063a2e7dc1ebe6ee6a7aa6bff099eaea09 Mon Sep 17 00:00:00 2001 From: Srujan Gaddam <58529443+srujzs@users.noreply.github.com> Date: Mon, 23 Dec 2024 12:13:50 -0800 Subject: [PATCH] Handle unnecessary_non_null_assertion and invalid_null_aware_operator (#2554) It looks like the environment field is correctly analyzed as never possibly null with a newer version of Dart. This fixes Dart CI. --- dwds/test/build/min_sdk_test.dart | 2 +- webdev/test/build/min_sdk_test.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dwds/test/build/min_sdk_test.dart b/dwds/test/build/min_sdk_test.dart index d4af9ceed..4cc13c929 100644 --- a/dwds/test/build/min_sdk_test.dart +++ b/dwds/test/build/min_sdk_test.dart @@ -19,7 +19,7 @@ void main() { sdkVersion = Version(sdkVersion.major, sdkVersion.minor, 0); final sdkConstraint = VersionConstraint.compatibleWith(sdkVersion); - final pubspecSdkConstraint = pubspec.environment?['sdk']; + final pubspecSdkConstraint = pubspec.environment['sdk']; expect(pubspecSdkConstraint, isNotNull); expect( sdkConstraint.allowsAll(pubspecSdkConstraint!), diff --git a/webdev/test/build/min_sdk_test.dart b/webdev/test/build/min_sdk_test.dart index 1e37a280f..84afbed1a 100644 --- a/webdev/test/build/min_sdk_test.dart +++ b/webdev/test/build/min_sdk_test.dart @@ -19,7 +19,7 @@ void main() { sdkVersion = Version(sdkVersion.major, sdkVersion.minor, 0); final sdkConstraint = VersionConstraint.compatibleWith(sdkVersion); - final pubspecSdkConstraint = pubspec.environment!['sdk']!; + final pubspecSdkConstraint = pubspec.environment['sdk']!; expect(sdkConstraint.allowsAll(pubspecSdkConstraint), true, reason: 'Min sdk constraint is outdated. Please update SDK constraint in '