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

Side by Side Diff: tests/language/issue10204_test.dart

Issue 14109026: Fix checked mode error. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Regression test for dart2js that used to miscompile 5 // Regression test for dart2js that used to miscompile
6 // [A.visitInvokeDynamicMethod]. 6 // [A.visitInvokeDynamicMethod].
7 7
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 9
10 var a = 2; 10 var a = 2;
11 11
12 class Tupe { 12 class Tupe {
13 const Tupe(); 13 const Tupe();
14 get instructionType => a == 2 ? this : new A(); 14 get instructionType => a == 2 ? this : new A();
15 refine(a, b) => '$a$b'; 15 refine(a, b) => '$a$b';
16 } 16 }
17 17
18 class Node { 18 class Node {
19 final selector = null; 19 final selector = null;
20 var inputs = {"a": const Tupe(), "b": const Tupe() }; 20 var inputs = {"a": const Tupe(), "b": const Tupe() };
21 bool isCallOnInterceptor; 21 bool isCallOnInterceptor = false;
22 22
23 getDartReceiver() { 23 getDartReceiver() {
24 return isCallOnInterceptor ? inputs["a"] : inputs["b"]; 24 return isCallOnInterceptor ? inputs["a"] : inputs["b"];
25 } 25 }
26 } 26 }
27 27
28 class A { 28 class A {
29 visitInvokeDynamicMethod(node) { 29 visitInvokeDynamicMethod(node) {
30 var receiverType = node.getDartReceiver().instructionType; 30 var receiverType = node.getDartReceiver().instructionType;
31 return receiverType.refine(node.selector, node.selector); 31 return receiverType.refine(node.selector, node.selector);
32 } 32 }
33 } 33 }
34 34
35 main() { 35 main() {
36 Expect.equals('nullnull', 36 Expect.equals('nullnull',
37 [new A()].last.visitInvokeDynamicMethod(new Node())); 37 [new A()].last.visitInvokeDynamicMethod(new Node()));
38 } 38 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698