| 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 10014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10025 | 10025 |
| 10026 void test_visitDoubleLiteral() { | 10026 void test_visitDoubleLiteral() { |
| 10027 // 4.33 | 10027 // 4.33 |
| 10028 Expression node = AstFactory.doubleLiteral(4.33); | 10028 Expression node = AstFactory.doubleLiteral(4.33); |
| 10029 expect(_analyze(node), same(_typeProvider.doubleType)); | 10029 expect(_analyze(node), same(_typeProvider.doubleType)); |
| 10030 _listener.assertNoErrors(); | 10030 _listener.assertNoErrors(); |
| 10031 } | 10031 } |
| 10032 | 10032 |
| 10033 void test_visitFunctionExpression_async_block() { | 10033 void test_visitFunctionExpression_async_block() { |
| 10034 // () async {} | 10034 // () async {} |
| 10035 InterfaceType intType = _typeProvider.intType; | |
| 10036 BlockFunctionBody body = AstFactory.blockFunctionBody2(); | 10035 BlockFunctionBody body = AstFactory.blockFunctionBody2(); |
| 10037 body.keyword = TokenFactory.tokenFromString('async'); | 10036 body.keyword = TokenFactory.tokenFromString('async'); |
| 10038 FunctionExpression node = | 10037 FunctionExpression node = |
| 10039 _resolvedFunctionExpression(AstFactory.formalParameterList([]), body); | 10038 _resolvedFunctionExpression(AstFactory.formalParameterList([]), body); |
| 10040 DartType resultType = _analyze(node); | 10039 DartType resultType = _analyze(node); |
| 10041 _assertFunctionType( | 10040 _assertFunctionType( |
| 10042 _typeProvider.futureDynamicType, | 10041 _typeProvider.futureDynamicType, |
| 10043 null, | 10042 null, |
| 10044 null, | 10043 null, |
| 10045 null, | 10044 null, |
| (...skipping 3746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13792 // check propagated type | 13791 // check propagated type |
| 13793 FunctionType propagatedType = node.propagatedType as FunctionType; | 13792 FunctionType propagatedType = node.propagatedType as FunctionType; |
| 13794 expect(propagatedType.returnType, test.typeProvider.stringType); | 13793 expect(propagatedType.returnType, test.typeProvider.stringType); |
| 13795 } on AnalysisException catch (e, stackTrace) { | 13794 } on AnalysisException catch (e, stackTrace) { |
| 13796 thrownException[0] = new CaughtException(e, stackTrace); | 13795 thrownException[0] = new CaughtException(e, stackTrace); |
| 13797 } | 13796 } |
| 13798 } | 13797 } |
| 13799 return null; | 13798 return null; |
| 13800 } | 13799 } |
| 13801 } | 13800 } |
| OLD | NEW |