| 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 library analyzer.test.generated.resolver_test; | 5 library analyzer.test.generated.resolver_test; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| (...skipping 13204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13215 } | 13215 } |
| 13216 | 13216 |
| 13217 void test_genericFunction_parameter() { | 13217 void test_genericFunction_parameter() { |
| 13218 _resolveTestUnit(r''' | 13218 _resolveTestUnit(r''' |
| 13219 void g(/*=T*/ f/*<T>*/(/*=T*/ x)) {} | 13219 void g(/*=T*/ f/*<T>*/(/*=T*/ x)) {} |
| 13220 '''); | 13220 '''); |
| 13221 SimpleIdentifier f = _findIdentifier('f'); | 13221 SimpleIdentifier f = _findIdentifier('f'); |
| 13222 ParameterElementImpl e = f.staticElement; | 13222 ParameterElementImpl e = f.staticElement; |
| 13223 FunctionType type = e.type; | 13223 FunctionType type = e.type; |
| 13224 expect(e.typeParameters.toString(), '[T]'); | 13224 expect(e.typeParameters.toString(), '[T]'); |
| 13225 expect(type.boundTypeParameters.toString(), '[T]'); | 13225 expect(type.typeFormals.toString(), '[T]'); |
| 13226 expect(type.toString(), '<T>(T) → T'); | 13226 expect(type.toString(), '<T>(T) → T'); |
| 13227 FunctionType ft = type.instantiate([typeProvider.stringType]); | 13227 FunctionType ft = type.instantiate([typeProvider.stringType]); |
| 13228 expect(ft.toString(), '(String) → String'); | 13228 expect(ft.toString(), '(String) → String'); |
| 13229 } | 13229 } |
| 13230 | 13230 |
| 13231 void test_genericFunction_static() { | 13231 void test_genericFunction_static() { |
| 13232 _resolveTestUnit(r''' | 13232 _resolveTestUnit(r''' |
| 13233 class C<E> { | 13233 class C<E> { |
| 13234 static /*=T*/ f/*<T>*/(/*=T*/ x) => null; | 13234 static /*=T*/ f/*<T>*/(/*=T*/ x) => null; |
| 13235 } | 13235 } |
| (...skipping 3362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16598 | 16598 |
| 16599 void _resolveTestUnit(String code) { | 16599 void _resolveTestUnit(String code) { |
| 16600 testCode = code; | 16600 testCode = code; |
| 16601 testSource = addSource(testCode); | 16601 testSource = addSource(testCode); |
| 16602 LibraryElement library = resolve2(testSource); | 16602 LibraryElement library = resolve2(testSource); |
| 16603 assertNoErrors(testSource); | 16603 assertNoErrors(testSource); |
| 16604 verify([testSource]); | 16604 verify([testSource]); |
| 16605 testUnit = resolveCompilationUnit(testSource, library); | 16605 testUnit = resolveCompilationUnit(testSource, library); |
| 16606 } | 16606 } |
| 16607 } | 16607 } |
| OLD | NEW |