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

Side by Side Diff: test/checker/checker_test.dart

Issue 1064933006: Enable downward inference on default params (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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 | « lib/src/checker/checker.dart ('k') | test/checker/inferred_type_test.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /// General type checking tests 5 /// General type checking tests
6 library dev_compiler.test.checker_test; 6 library dev_compiler.test.checker_test;
7 7
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 import 'package:dev_compiler/src/testing.dart'; 10 import 'package:dev_compiler/src/testing.dart';
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 T foo() => /*warning:DownCastImplicit*/null; 160 T foo() => /*warning:DownCastImplicit*/null;
161 161
162 void bar() { 162 void bar() {
163 int /*severe:InvalidVariableDeclaration*/x; 163 int /*severe:InvalidVariableDeclaration*/x;
164 num y; 164 num y;
165 // TODO(vsm): This should be a runtime check: 165 // TODO(vsm): This should be a runtime check:
166 // Transformed to: T z = cast(null, T) 166 // Transformed to: T z = cast(null, T)
167 T /*severe:InvalidVariableDeclaration*/z; 167 T /*severe:InvalidVariableDeclaration*/z;
168 } 168 }
169 169
170 void baz(T x, [T /*severe:InvalidVariableDeclaration*/y, T z = /*sever e:StaticTypeError*/null]) { 170 void baz(T x, [T /*severe:InvalidVariableDeclaration*/y, T z = /*warni ng:DownCastImplicit*/null]) {
171 } 171 }
172 } 172 }
173 173
174 class B<T extends List> { 174 class B<T extends List> {
175 T x; 175 T x;
176 176
177 // T cannot be primitive. 177 // T cannot be primitive.
178 T foo() => null; 178 T foo() => null;
179 } 179 }
180 180
(...skipping 2651 matching lines...) Expand 10 before | Expand all | Expand 10 after
2832 f = bar as II2D; 2832 f = bar as II2D;
2833 f = bar as DD2I; 2833 f = bar as DD2I;
2834 f = bar as DI2D; 2834 f = bar as DI2D;
2835 f = bar as ID2D; 2835 f = bar as ID2D;
2836 f = bar as DD2D; 2836 f = bar as DD2D;
2837 } 2837 }
2838 ''' 2838 '''
2839 }); 2839 });
2840 }); 2840 });
2841 } 2841 }
OLDNEW
« no previous file with comments | « lib/src/checker/checker.dart ('k') | test/checker/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698