OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.strong_mode_test; | 5 library analyzer.test.generated.strong_mode_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 expect(functionReturnValue(4).staticType, typeProvider.stringType); | 923 expect(functionReturnValue(4).staticType, typeProvider.stringType); |
924 } | 924 } |
925 | 925 |
926 test_inference_hints() async { | 926 test_inference_hints() async { |
927 Source source = addSource(r''' | 927 Source source = addSource(r''' |
928 void main () { | 928 void main () { |
929 var x = 3; | 929 var x = 3; |
930 List<int> l0 = []; | 930 List<int> l0 = []; |
931 } | 931 } |
932 '''); | 932 '''); |
933 resolve2(source); | |
934 await computeAnalysisResult(source); | 933 await computeAnalysisResult(source); |
935 assertNoErrors(source); | 934 assertNoErrors(source); |
936 verify([source]); | 935 verify([source]); |
937 } | 936 } |
938 | 937 |
939 test_inferredFieldDeclaration_propagation() async { | 938 test_inferredFieldDeclaration_propagation() async { |
940 // Regression test for https://github.com/dart-lang/sdk/issues/25546 | 939 // Regression test for https://github.com/dart-lang/sdk/issues/25546 |
941 String code = r''' | 940 String code = r''' |
942 abstract class A { | 941 abstract class A { |
943 Map<int, List<int>> get map; | 942 Map<int, List<int>> get map; |
(...skipping 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3082 var v = x; | 3081 var v = x; |
3083 v; // marker | 3082 v; // marker |
3084 } | 3083 } |
3085 int x = 3; | 3084 int x = 3; |
3086 '''; | 3085 '''; |
3087 CompilationUnit unit = await resolveSource(code); | 3086 CompilationUnit unit = await resolveSource(code); |
3088 assertPropagatedAssignedType(code, unit, typeProvider.intType, null); | 3087 assertPropagatedAssignedType(code, unit, typeProvider.intType, null); |
3089 assertTypeOfMarkedExpression(code, unit, typeProvider.intType, null); | 3088 assertTypeOfMarkedExpression(code, unit, typeProvider.intType, null); |
3090 } | 3089 } |
3091 } | 3090 } |
OLD | NEW |