You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FAILED: dart2analyzer-none release_arm64 co19/LanguageFeatures/Patterns/null_check_A02_t01
Expected: Pass
Actual: MissingCompileTimeError
--- Command "dart2analyzer" (took 16ms):
DART_CONFIGURATION=ReleaseARM64 sdk/bin/dart --packages=.dart_tool/package_config.json pkg/analyzer_cli/bin/analyzer.dart --use-analysis-driver-memory-byte-store --dart-sdk=/Users/scheglov/Source/Dart/sdk.git/sdk/sdk -Dtest_runner.configuration=custom-configuration-1 --enable-experiment=patterns --ignore-unrecognized-flags --packages=/Users/scheglov/Source/Dart/sdk.git/sdk/.dart_tool/package_config.json --format=json /Users/scheglov/Source/Dart/sdk.git/sdk/tests/co19/src/LanguageFeatures/Patterns/null_check_A02_t01.dart
static error failures:
- Unexpected error at line 25, column 16, length 1: STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN
- Unexpected error at line 39, column 20, length 1: STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN
- Unexpected error at line 51, column 11, length 1: STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN
--- Re-run this test:
python3 tools/test.py -m release -c dart2analyzer -a arm64 co19/LanguageFeatures/Patterns/null_check_A02_t01
Code
Stringtest1(int? x) {
switch (x) {
caseint? v1!&&==1||int? v1?:// ^// [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN// [cfe] The null-check pattern will have no effect because the matched type isn't nullable.return"match-1";
caseint v2?:return"match-2";
default:return"no match";
}
}
In case int v2?: the matched type is int, by the same reason why it is int for int? v1? in the previous case - we have already executed int? v1!.
The text was updated successfully, but these errors were encountered:
Code
In
case int v2?:
the matched type isint
, by the same reason why it isint
forint? v1?
in the previouscase
- we have already executedint? v1!
.The text was updated successfully, but these errors were encountered: