| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 ElementFactory.constructorElement2(completerElement, null); | 230 ElementFactory.constructorElement2(completerElement, null); |
| 231 (completerConstructor.type as FunctionTypeImpl).typeArguments = | 231 (completerConstructor.type as FunctionTypeImpl).typeArguments = |
| 232 completerElement.type.typeArguments; | 232 completerElement.type.typeArguments; |
| 233 completerElement.constructors = <ConstructorElement>[completerConstructor]; | 233 completerElement.constructors = <ConstructorElement>[completerConstructor]; |
| 234 // StreamSubscription | 234 // StreamSubscription |
| 235 ClassElementImpl streamSubscriptionElement = | 235 ClassElementImpl streamSubscriptionElement = |
| 236 ElementFactory.classElement2("StreamSubscription", ["T"]); | 236 ElementFactory.classElement2("StreamSubscription", ["T"]); |
| 237 // Stream | 237 // Stream |
| 238 ClassElementImpl streamElement = | 238 ClassElementImpl streamElement = |
| 239 ElementFactory.classElement2("Stream", ["T"]); | 239 ElementFactory.classElement2("Stream", ["T"]); |
| 240 streamElement.constructors = <ConstructorElement>[ |
| 241 ElementFactory.constructorElement2(streamElement, null) |
| 242 ]; |
| 240 DartType returnType = streamSubscriptionElement.type | 243 DartType returnType = streamSubscriptionElement.type |
| 241 .substitute4(streamElement.type.typeArguments); | 244 .substitute4(streamElement.type.typeArguments); |
| 242 List<DartType> parameterTypes = <DartType>[ | 245 List<DartType> parameterTypes = <DartType>[ |
| 243 ElementFactory | 246 ElementFactory |
| 244 .functionElement3('onData', VoidTypeImpl.instance.element, | 247 .functionElement3('onData', VoidTypeImpl.instance.element, |
| 245 <TypeDefiningElement>[streamElement.typeParameters[0]], null) | 248 <TypeDefiningElement>[streamElement.typeParameters[0]], null) |
| 246 .type, | 249 .type, |
| 247 ]; | 250 ]; |
| 248 // TODO(brianwilkerson) This is missing the optional parameters. | 251 // TODO(brianwilkerson) This is missing the optional parameters. |
| 249 MethodElementImpl listenMethod = | 252 MethodElementImpl listenMethod = |
| (...skipping 14074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14324 // check propagated type | 14327 // check propagated type |
| 14325 FunctionType propagatedType = node.propagatedType as FunctionType; | 14328 FunctionType propagatedType = node.propagatedType as FunctionType; |
| 14326 expect(propagatedType.returnType, test.typeProvider.stringType); | 14329 expect(propagatedType.returnType, test.typeProvider.stringType); |
| 14327 } on AnalysisException catch (e, stackTrace) { | 14330 } on AnalysisException catch (e, stackTrace) { |
| 14328 thrownException[0] = new CaughtException(e, stackTrace); | 14331 thrownException[0] = new CaughtException(e, stackTrace); |
| 14329 } | 14332 } |
| 14330 } | 14333 } |
| 14331 return null; | 14334 return null; |
| 14332 } | 14335 } |
| 14333 } | 14336 } |
| OLD | NEW |