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

Side by Side Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 1425593006: Record defensive dynamic invokes for unresolved field accesses (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | 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 // TODO(jmesserly): this file needs to be refactored, it's a port from 5 // TODO(jmesserly): this file needs to be refactored, it's a port from
6 // package:dev_compiler's tests 6 // package:dev_compiler's tests
7 /// General type checking tests 7 /// General type checking tests
8 library test.src.task.strong.checker_test; 8 library test.src.task.strong.checker_test;
9 9
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 (/*info:DynamicInvoke*/f.col(3)); 118 (/*info:DynamicInvoke*/f.col(3));
119 } 119 }
120 { 120 {
121 A f = new B(); 121 A f = new B();
122 int x; 122 int x;
123 double y; 123 double y;
124 x = /*info:DynamicCast, info:DynamicInvoke*/f(3); 124 x = /*info:DynamicCast, info:DynamicInvoke*/f(3);
125 y = /*info:DynamicCast, info:DynamicInvoke*/f(3); 125 y = /*info:DynamicCast, info:DynamicInvoke*/f(3);
126 (/*info:DynamicInvoke*/f(3.0)); 126 (/*info:DynamicInvoke*/f(3.0));
127 } 127 }
128 {
129 dynamic g = new B();
130 (/*info:DynamicInvoke*/g.call(32.0));
131 (/*info:DynamicInvoke*/g.col(42.0));
132 (/*info:DynamicInvoke*/g.foo(42.0));
133 (/*info:DynamicInvoke*/g.x);
134 A f = new B();
135 f.call(32.0);
136 (/*info:DynamicInvoke*/f.col(42.0));
137 (/*info:DynamicInvoke*/f.foo(42.0));
138 (/*info:DynamicInvoke*/f.x);
139 }
128 } 140 }
129 ''' 141 '''
130 }); 142 });
131 143
132 testChecker('conversion and dynamic invoke', { 144 testChecker('conversion and dynamic invoke', {
133 '/helper.dart': ''' 145 '/helper.dart': '''
134 dynamic toString = (int x) => x + 42; 146 dynamic toString = (int x) => x + 42;
135 dynamic hashCode = "hello"; 147 dynamic hashCode = "hello";
136 ''', 148 ''',
137 '/main.dart': ''' 149 '/main.dart': '''
(...skipping 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2302 2314
2303 baz1() sync* { yield* (/*info:DynamicCast*/x); } 2315 baz1() sync* { yield* (/*info:DynamicCast*/x); }
2304 Iterable baz2() sync* { yield* (/*info:DynamicCast*/x); } 2316 Iterable baz2() sync* { yield* (/*info:DynamicCast*/x); }
2305 Iterable<int> baz3() sync* { yield* (/*warning:DownCastComposite*/x); } 2317 Iterable<int> baz3() sync* { yield* (/*warning:DownCastComposite*/x); }
2306 Iterable<int> baz4() sync* { yield* new Iterable<int>(); } 2318 Iterable<int> baz4() sync* { yield* new Iterable<int>(); }
2307 Iterable<int> baz5() sync* { yield* (/*info:InferredTypeAllocation*/new Iterable()); } 2319 Iterable<int> baz5() sync* { yield* (/*info:InferredTypeAllocation*/new Iterable()); }
2308 ''' 2320 '''
2309 }); 2321 });
2310 }); 2322 });
2311 } 2323 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698