| 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/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| (...skipping 10373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10384 * | 10384 * |
| 10385 * @param node the expression with which the type is associated | 10385 * @param node the expression with which the type is associated |
| 10386 * @param thisType the type of 'this' | 10386 * @param thisType the type of 'this' |
| 10387 * @param useStaticType `true` if the static type is being requested, and `fal
se` if | 10387 * @param useStaticType `true` if the static type is being requested, and `fal
se` if |
| 10388 * the propagated type is being requested | 10388 * the propagated type is being requested |
| 10389 * @return the type associated with the expression | 10389 * @return the type associated with the expression |
| 10390 */ | 10390 */ |
| 10391 DartType _analyze4(Expression node, InterfaceType thisType, | 10391 DartType _analyze4(Expression node, InterfaceType thisType, |
| 10392 bool useStaticType) { | 10392 bool useStaticType) { |
| 10393 try { | 10393 try { |
| 10394 _analyzer.thisType_J2DAccessor = thisType; | 10394 _analyzer.thisType = thisType; |
| 10395 } catch (exception) { | 10395 } catch (exception) { |
| 10396 throw new IllegalArgumentException( | 10396 throw new IllegalArgumentException( |
| 10397 "Could not set type of 'this'", | 10397 "Could not set type of 'this'", |
| 10398 exception); | 10398 exception); |
| 10399 } | 10399 } |
| 10400 node.accept(_analyzer); | 10400 node.accept(_analyzer); |
| 10401 if (useStaticType) { | 10401 if (useStaticType) { |
| 10402 return node.staticType; | 10402 return node.staticType; |
| 10403 } else { | 10403 } else { |
| 10404 return node.propagatedType; | 10404 return node.propagatedType; |
| (...skipping 3360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13765 // check propagated type | 13765 // check propagated type |
| 13766 FunctionType propagatedType = node.propagatedType as FunctionType; | 13766 FunctionType propagatedType = node.propagatedType as FunctionType; |
| 13767 expect(propagatedType.returnType, test.typeProvider.stringType); | 13767 expect(propagatedType.returnType, test.typeProvider.stringType); |
| 13768 } on AnalysisException catch (e, stackTrace) { | 13768 } on AnalysisException catch (e, stackTrace) { |
| 13769 thrownException[0] = new CaughtException(e, stackTrace); | 13769 thrownException[0] = new CaughtException(e, stackTrace); |
| 13770 } | 13770 } |
| 13771 } | 13771 } |
| 13772 return null; | 13772 return null; |
| 13773 } | 13773 } |
| 13774 } | 13774 } |
| OLD | NEW |