File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
LanguageFeatures/Patterns Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ String test1(int? x) {
23
23
// [cfe] The null-check pattern will have no effect because the matched type isn't nullable.
24
24
return "match-1" ;
25
25
case int v2?:
26
+ // ^
27
+ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN
28
+ // [cfe] The null-check pattern will have no effect because the matched type isn't nullable.
26
29
return "match-2" ;
27
30
default :
28
31
return "no match" ;
@@ -37,6 +40,9 @@ String test2(int? x) {
37
40
return "match-2" ;
38
41
}
39
42
if (x case int v2? ) {
43
+ // ^
44
+ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN
45
+ // [cfe] The null-check pattern will have no effect because the matched type isn't nullable.
40
46
return "match-2" ;
41
47
}
42
48
return "no match" ;
@@ -49,6 +55,9 @@ String test3(int? x) =>
49
55
// [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN
50
56
// [cfe] The null-check pattern will have no effect because the matched type isn't nullable.
51
57
int v2? => "match-2" ,
58
+ // ^
59
+ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN
60
+ // [cfe] The null-check pattern will have no effect because the matched type isn't nullable.
52
61
_ => "no match"
53
62
};
54
63
You can’t perform that action at this time.
0 commit comments