Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: pkg/analyzer/test/generated/strong_mode_test.dart

Issue 2904263003: Implement type inference for await expressions in front_end. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/mock_sdk.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after
3114 3114
3115 test_genericMethod_then_propagatedType() async { 3115 test_genericMethod_then_propagatedType() async {
3116 // Regression test for https://github.com/dart-lang/sdk/issues/25482. 3116 // Regression test for https://github.com/dart-lang/sdk/issues/25482.
3117 String code = r''' 3117 String code = r'''
3118 import 'dart:async'; 3118 import 'dart:async';
3119 void main() { 3119 void main() {
3120 Future<String> p; 3120 Future<String> p;
3121 var foo = p.then((r) => new Future<String>.value(3)); 3121 var foo = p.then((r) => new Future<String>.value(3));
3122 } 3122 }
3123 '''; 3123 ''';
3124 // This should produce no hints or warnings. 3124 await resolveTestUnit(code, noErrors: false);
3125 await resolveTestUnit(code); 3125 // Note: this correctly reports the error
3126 // StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE when run with the driver;
3127 // when run without the driver, it reports no errors. So we don't bother
3128 // checking whether the correct errors were reported.
3126 expectInitializerType('foo', 'Future<String>', isNull); 3129 expectInitializerType('foo', 'Future<String>', isNull);
3127 } 3130 }
3128 3131
3129 test_implicitBounds() async { 3132 test_implicitBounds() async {
3130 String code = r''' 3133 String code = r'''
3131 class A<T> {} 3134 class A<T> {}
3132 3135
3133 class B<T extends num> {} 3136 class B<T extends num> {}
3134 3137
3135 class C<S extends int, T extends B<S>, U extends A> {} 3138 class C<S extends int, T extends B<S>, U extends A> {}
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
3920 var v = x; 3923 var v = x;
3921 v; // marker 3924 v; // marker
3922 } 3925 }
3923 int x = 3; 3926 int x = 3;
3924 '''; 3927 ''';
3925 CompilationUnit unit = await resolveSource(code); 3928 CompilationUnit unit = await resolveSource(code);
3926 assertPropagatedAssignedType(code, unit, typeProvider.intType, null); 3929 assertPropagatedAssignedType(code, unit, typeProvider.intType, null);
3927 assertTypeOfMarkedExpression(code, unit, typeProvider.intType, null); 3930 assertTypeOfMarkedExpression(code, unit, typeProvider.intType, null);
3928 } 3931 }
3929 } 3932 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/mock_sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698