| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
| 8 import 'package:analyzer/src/dart/analysis/driver.dart'; | 8 import 'package:analyzer/src/dart/analysis/driver.dart'; |
| 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 10 | 10 |
| (...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1515 } | 1515 } |
| 1516 '''); | 1516 '''); |
| 1517 } | 1517 } |
| 1518 | 1518 |
| 1519 test_instanceField_functionTypeAlias_doesNotUseItsTypeParameter() async { | 1519 test_instanceField_functionTypeAlias_doesNotUseItsTypeParameter() async { |
| 1520 var library = await _encodeDecodeLibrary(r''' | 1520 var library = await _encodeDecodeLibrary(r''' |
| 1521 typedef F<T>(); | 1521 typedef F<T>(); |
| 1522 | 1522 |
| 1523 class A<T> { | 1523 class A<T> { |
| 1524 F<T> get x => null; | 1524 F<T> get x => null; |
| 1525 List<F<T>> get y => null; |
| 1525 } | 1526 } |
| 1526 | 1527 |
| 1527 class B extends A<int> { | 1528 class B extends A<int> { |
| 1528 get x => null; | 1529 get x => null; |
| 1530 get y => null; |
| 1529 } | 1531 } |
| 1530 '''); | 1532 '''); |
| 1531 checkElementText( | 1533 checkElementText( |
| 1532 library, | 1534 library, |
| 1533 r''' | 1535 r''' |
| 1534 typedef dynamic F<T>(); | 1536 typedef dynamic F<T>(); |
| 1535 class A<T> { | 1537 class A<T> { |
| 1536 F<T> get x {} | 1538 F<T> get x {} |
| 1539 List<F<T>> get y {} |
| 1537 } | 1540 } |
| 1538 class B extends A<int> { | 1541 class B extends A<int> { |
| 1539 F<int> get x {} | 1542 F<int> get x {} |
| 1543 List<F<int>> get y {} |
| 1540 } | 1544 } |
| 1541 '''); | 1545 '''); |
| 1542 } | 1546 } |
| 1543 | 1547 |
| 1544 test_instanceField_inheritsCovariant_fromSetter_field() async { | 1548 test_instanceField_inheritsCovariant_fromSetter_field() async { |
| 1545 var library = await _encodeDecodeLibrary(r''' | 1549 var library = await _encodeDecodeLibrary(r''' |
| 1546 abstract class A { | 1550 abstract class A { |
| 1547 num get x; | 1551 num get x; |
| 1548 void set x(covariant num _); | 1552 void set x(covariant num _); |
| 1549 } | 1553 } |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2206 | 2210 |
| 2207 Future<LibraryElement> _encodeDecodeLibrary(String text) async { | 2211 Future<LibraryElement> _encodeDecodeLibrary(String text) async { |
| 2208 String path = _p('/test.dart'); | 2212 String path = _p('/test.dart'); |
| 2209 provider.newFile(path, text); | 2213 provider.newFile(path, text); |
| 2210 UnitElementResult result = await driver.getUnitElement(path); | 2214 UnitElementResult result = await driver.getUnitElement(path); |
| 2211 return result.element.library; | 2215 return result.element.library; |
| 2212 } | 2216 } |
| 2213 | 2217 |
| 2214 String _p(String path) => provider.convertPath(path); | 2218 String _p(String path) => provider.convertPath(path); |
| 2215 } | 2219 } |
| OLD | NEW |