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

Side by Side Diff: tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart

Issue 2955353002: Split inference type-info accessors into members, parameters and local functions (Closed)
Patch Set: Cleanup Created 3 years, 5 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
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 import 'package:async_helper/async_helper.dart'; 5 import 'package:async_helper/async_helper.dart';
6 import 'package:expect/expect.dart'; 6 import 'package:expect/expect.dart';
7 7
8 import 'compiler_helper.dart'; 8 import 'compiler_helper.dart';
9 import 'type_mask_test_helper.dart'; 9 import 'type_mask_test_helper.dart';
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 var typesInferrer = compiler.globalInference.typesInferrerInternal; 69 var typesInferrer = compiler.globalInference.typesInferrerInternal;
70 var closedWorld = typesInferrer.closedWorld; 70 var closedWorld = typesInferrer.closedWorld;
71 var commonMasks = closedWorld.commonMasks; 71 var commonMasks = closedWorld.commonMasks;
72 72
73 checkReturnInClass(String className, String methodName, type) { 73 checkReturnInClass(String className, String methodName, type) {
74 dynamic cls = findElement(compiler, className); 74 dynamic cls = findElement(compiler, className);
75 var element = cls.lookupLocalMember(methodName); 75 var element = cls.lookupLocalMember(methodName);
76 Expect.equals( 76 Expect.equals(
77 type, 77 type,
78 simplify( 78 simplify(
79 typesInferrer.getReturnTypeOfElement(element), closedWorld), 79 typesInferrer.getReturnTypeOfMember(element), closedWorld),
80 methodName); 80 methodName);
81 } 81 }
82 82
83 var subclassOfInterceptor = commonMasks.interceptorType; 83 var subclassOfInterceptor = commonMasks.interceptorType;
84 84
85 checkReturnInClass('A', 'returnNum1', commonMasks.numType); 85 checkReturnInClass('A', 'returnNum1', commonMasks.numType);
86 checkReturnInClass('A', 'returnNum2', commonMasks.numType); 86 checkReturnInClass('A', 'returnNum2', commonMasks.numType);
87 checkReturnInClass('A', 'returnNum3', commonMasks.numType); 87 checkReturnInClass('A', 'returnNum3', commonMasks.numType);
88 checkReturnInClass('A', 'returnNum4', commonMasks.numType); 88 checkReturnInClass('A', 'returnNum4', commonMasks.numType);
89 checkReturnInClass('A', 'returnEmpty1', const TypeMask.nonNullEmpty()); 89 checkReturnInClass('A', 'returnEmpty1', const TypeMask.nonNullEmpty());
90 checkReturnInClass('A', 'returnEmpty2', const TypeMask.nonNullEmpty()); 90 checkReturnInClass('A', 'returnEmpty2', const TypeMask.nonNullEmpty());
91 checkReturnInClass('A', 'returnDynamic1', subclassOfInterceptor); 91 checkReturnInClass('A', 'returnDynamic1', subclassOfInterceptor);
92 checkReturnInClass('A', 'returnDynamic2', subclassOfInterceptor); 92 checkReturnInClass('A', 'returnDynamic2', subclassOfInterceptor);
93 checkReturnInClass('A', 'returnEmpty3', const TypeMask.nonNullEmpty()); 93 checkReturnInClass('A', 'returnEmpty3', const TypeMask.nonNullEmpty());
94 94
95 checkReturnInClass('B', 'returnString1', commonMasks.stringType); 95 checkReturnInClass('B', 'returnString1', commonMasks.stringType);
96 checkReturnInClass('B', 'returnString2', commonMasks.stringType); 96 checkReturnInClass('B', 'returnString2', commonMasks.stringType);
97 checkReturnInClass( 97 checkReturnInClass(
98 'B', 'returnDynamic1', const TypeMask.nonNullEmpty()); 98 'B', 'returnDynamic1', const TypeMask.nonNullEmpty());
99 checkReturnInClass( 99 checkReturnInClass(
100 'B', 'returnDynamic2', const TypeMask.nonNullEmpty()); 100 'B', 'returnDynamic2', const TypeMask.nonNullEmpty());
101 checkReturnInClass( 101 checkReturnInClass(
102 'B', 'returnDynamic3', const TypeMask.nonNullEmpty()); 102 'B', 'returnDynamic3', const TypeMask.nonNullEmpty());
103 checkReturnInClass( 103 checkReturnInClass(
104 'B', 'returnDynamic4', const TypeMask.nonNullEmpty()); 104 'B', 'returnDynamic4', const TypeMask.nonNullEmpty());
105 })); 105 }));
106 } 106 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698