@@ -85,6 +85,31 @@ void g(C a) {}
85
85
''' );
86
86
}
87
87
88
+ test_genericTypeArgument_extensionType_missingTypeArg () async {
89
+ await assertErrorsInCode (r'''
90
+ extension type E<T>(int i) {}
91
+
92
+ void f() {
93
+ var e = <List<E>>[];
94
+ }
95
+ ''' , [
96
+ error (WarningCode .UNUSED_LOCAL_VARIABLE , 48 , 1 ),
97
+ error (WarningCode .STRICT_RAW_TYPE , 58 , 1 ),
98
+ ]);
99
+ }
100
+
101
+ test_genericTypeArgument_extensionType_withTypeArg () async {
102
+ await assertErrorsInCode (r'''
103
+ extension type E<T>(int i) {}
104
+
105
+ void f() {
106
+ var e = <List<E<int>>>[];
107
+ }
108
+ ''' , [
109
+ error (WarningCode .UNUSED_LOCAL_VARIABLE , 48 , 1 ),
110
+ ]);
111
+ }
112
+
88
113
test_genericTypeArgument_missingTypeArg () async {
89
114
await assertErrorsInCode (r'''
90
115
void f() {
@@ -124,6 +149,31 @@ void f(dynamic x) {
124
149
''' );
125
150
}
126
151
152
+ test_localVariable_extensionType_missingTypeArg () async {
153
+ await assertErrorsInCode (r'''
154
+ extension type E<T>(int i) {}
155
+
156
+ void f() {
157
+ E e = E(1);
158
+ }
159
+ ''' , [
160
+ error (WarningCode .STRICT_RAW_TYPE , 48 , 1 ),
161
+ error (WarningCode .UNUSED_LOCAL_VARIABLE , 50 , 1 ),
162
+ ]);
163
+ }
164
+
165
+ test_localVariable_extensionType_withTypeArg () async {
166
+ await assertErrorsInCode (r'''
167
+ extension type E<T>(int i) {}
168
+
169
+ void f() {
170
+ E<int> e = E<int>(1);
171
+ }
172
+ ''' , [
173
+ error (WarningCode .UNUSED_LOCAL_VARIABLE , 55 , 1 ),
174
+ ]);
175
+ }
176
+
127
177
test_localVariable_missingTypeArg () async {
128
178
await assertErrorsInCode (r'''
129
179
void f() {
0 commit comments