| 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 engine.resolver_test; | 5 library engine.resolver_test; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/context/context.dart' as newContext; | 9 import 'package:analyzer/src/context/context.dart' as newContext; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 12201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12212 | 12212 |
| 12213 SimpleIdentifier c = _findIdentifier('cOfString'); | 12213 SimpleIdentifier c = _findIdentifier('cOfString'); |
| 12214 FunctionType ft = (c.staticType as InterfaceType).getMethod('f').type; | 12214 FunctionType ft = (c.staticType as InterfaceType).getMethod('f').type; |
| 12215 expect(ft.toString(), '(String) → List<T>'); | 12215 expect(ft.toString(), '(String) → List<T>'); |
| 12216 DartType t = e.typeParameters[0].type; | 12216 DartType t = e.typeParameters[0].type; |
| 12217 ft = ft.substitute2([typeProvider.intType], [t]); | 12217 ft = ft.substitute2([typeProvider.intType], [t]); |
| 12218 expect(ft.toString(), '(String) → List<int>'); | 12218 expect(ft.toString(), '(String) → List<int>'); |
| 12219 } | 12219 } |
| 12220 | 12220 |
| 12221 void test_genericMethod_functionTypedParameter() { | 12221 void test_genericMethod_functionTypedParameter() { |
| 12222 if (!AnalysisEngine.instance.useTaskModel) { |
| 12223 return; |
| 12224 } |
| 12222 _resolveTestUnit(r''' | 12225 _resolveTestUnit(r''' |
| 12223 class C<E> { | 12226 class C<E> { |
| 12224 List/*<T>*/ f/*<T>*/(/*=T*/ f(E e)) => null; | 12227 List/*<T>*/ f/*<T>*/(/*=T*/ f(E e)) => null; |
| 12225 } | 12228 } |
| 12226 main() { | 12229 main() { |
| 12227 C<String> cOfString; | 12230 C<String> cOfString; |
| 12228 } | 12231 } |
| 12229 '''); | 12232 '''); |
| 12230 SimpleIdentifier f = _findIdentifier('f'); | 12233 SimpleIdentifier f = _findIdentifier('f'); |
| 12231 MethodElementImpl e = f.staticElement; | 12234 MethodElementImpl e = f.staticElement; |
| (...skipping 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15190 | 15193 |
| 15191 void _resolveTestUnit(String code) { | 15194 void _resolveTestUnit(String code) { |
| 15192 testCode = code; | 15195 testCode = code; |
| 15193 testSource = addSource(testCode); | 15196 testSource = addSource(testCode); |
| 15194 LibraryElement library = resolve2(testSource); | 15197 LibraryElement library = resolve2(testSource); |
| 15195 assertNoErrors(testSource); | 15198 assertNoErrors(testSource); |
| 15196 verify([testSource]); | 15199 verify([testSource]); |
| 15197 testUnit = resolveCompilationUnit(testSource, library); | 15200 testUnit = resolveCompilationUnit(testSource, library); |
| 15198 } | 15201 } |
| 15199 } | 15202 } |
| OLD | NEW |