OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
8 import 'package:analysis_server/protocol/protocol_generated.dart'; | 8 import 'package:analysis_server/protocol/protocol_generated.dart'; |
9 import 'package:analysis_server/src/edit/edit_domain.dart'; | 9 import 'package:analysis_server/src/edit/edit_domain.dart'; |
10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; | 10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 @MyAnnotation(3) | 173 @MyAnnotation(3) |
174 export 'dart:aaa'; | 174 export 'dart:aaa'; |
175 export 'dart:bbb'; | 175 export 'dart:bbb'; |
176 | 176 |
177 class MyAnnotation { | 177 class MyAnnotation { |
178 const MyAnnotation(_); | 178 const MyAnnotation(_); |
179 } | 179 } |
180 '''); | 180 '''); |
181 } | 181 } |
182 | 182 |
183 @failingTest | 183 test_OK_genericFunctionType() async { |
184 test_OK_genericFunctionTypeInComments() async { | |
185 addFile( | 184 addFile( |
186 projectPath + '/analysis_options.yaml', | 185 projectPath + '/analysis_options.yaml', |
187 ''' | 186 ''' |
188 analyzer: | 187 analyzer: |
189 strong-mode: true | 188 strong-mode: true |
190 '''); | 189 '''); |
191 addTestFile(''' | 190 addTestFile(''' |
192 class C { | 191 class C { |
193 void caller() { | 192 void caller() { |
194 Super s = new Super(); | 193 Super s = new Super(); |
195 takesSub(s); // <- No warning | 194 takesSub(s); // <- No warning |
196 } | 195 } |
197 | 196 |
198 void takesSub(Sub s) {} | 197 void takesSub(Sub s) {} |
199 } | 198 } |
200 | 199 |
201 class Sub extends Super {} | 200 class Sub extends Super {} |
202 | 201 |
203 class Super {} | 202 class Super {} |
204 | 203 |
205 typedef dynamic Func(String x, String y); | 204 typedef dynamic Func(String x, String y); |
206 | 205 |
207 Function/*=F*/ allowInterop/*<F extends Function>*/(Function/*=F*/ f) => null; | 206 F allowInterop<F extends Function>(F f) => null; |
208 | 207 |
209 Func bar(Func f) { | 208 Func bar(Func f) { |
210 return allowInterop(f); | 209 return allowInterop(f); |
211 } | 210 } |
212 '''); | 211 '''); |
213 return _assertSorted(''' | 212 return _assertSorted(''' |
214 Function/*=F*/ allowInterop/*<F extends Function>*/(Function/*=F*/ f) => null; | 213 F allowInterop<F extends Function>(F f) => null; |
215 | 214 |
216 Func bar(Func f) { | 215 Func bar(Func f) { |
217 return allowInterop(f); | 216 return allowInterop(f); |
218 } | 217 } |
219 | 218 |
220 typedef dynamic Func(String x, String y); | 219 typedef dynamic Func(String x, String y); |
221 | 220 |
222 class C { | 221 class C { |
223 void caller() { | 222 void caller() { |
224 Super s = new Super(); | 223 Super s = new Super(); |
(...skipping 28 matching lines...) Expand all Loading... |
253 expect(resultCode, expectedCode); | 252 expect(resultCode, expectedCode); |
254 } | 253 } |
255 | 254 |
256 Future _requestSort() async { | 255 Future _requestSort() async { |
257 Request request = new EditSortMembersParams(testFile).toRequest('0'); | 256 Request request = new EditSortMembersParams(testFile).toRequest('0'); |
258 Response response = await waitResponse(request); | 257 Response response = await waitResponse(request); |
259 var result = new EditSortMembersResult.fromResponse(response); | 258 var result = new EditSortMembersResult.fromResponse(response); |
260 fileEdit = result.edit; | 259 fileEdit = result.edit; |
261 } | 260 } |
262 } | 261 } |
OLD | NEW |