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

Unified Diff: tests/compiler/dart2js/needs_no_such_method_test.dart

Issue 2425933002: Revert "Change TypeInference to handle super calls as direct invocations." and "Optimize needNoSuch… (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/world.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/needs_no_such_method_test.dart
diff --git a/tests/compiler/dart2js/needs_no_such_method_test.dart b/tests/compiler/dart2js/needs_no_such_method_test.dart
index 892087e6db5501d61400bc092084c3bc112c19d7..3dadbb7f6949ec0295d303e66d1918d670355150 100644
--- a/tests/compiler/dart2js/needs_no_such_method_test.dart
+++ b/tests/compiler/dart2js/needs_no_such_method_test.dart
@@ -35,7 +35,6 @@ testClassSets() async {
Selector foo, bar, baz;
ClosedWorld closedWorld;
ClassElement superclass, subclass, subtype;
- String testMode;
Future run(List<String> instantiated) async {
StringBuffer main = new StringBuffer();
@@ -44,7 +43,6 @@ testClassSets() async {
main.write('new $cls();');
}
main.write('}');
- testMode = '$instantiated';
var env = await TypeEnvironment.create(CLASSES,
mainSource: main.toString(), useMockCompiler: false);
@@ -61,11 +59,8 @@ testClassSets() async {
void check(ClassElement cls, ClassQuery query, Selector selector,
bool expectedResult) {
bool result = closedWorld.needsNoSuchMethod(cls, selector, query);
- Expect.equals(
- expectedResult,
- result,
- 'Unexpected result for $selector in $cls ($query)'
- 'for instantiations $testMode');
+ Expect.equals(expectedResult, result,
+ 'Unexpected result for $selector in $cls ($query)');
}
await run([]);
@@ -171,13 +166,17 @@ testClassSets() async {
Expect.isFalse(closedWorld.isImplemented(subtype));
check(superclass, ClassQuery.EXACT, foo, false);
- check(superclass, ClassQuery.EXACT, bar, false);
- check(superclass, ClassQuery.EXACT, baz, false);
+ // Should be false since the class is not directly instantiated:
+ check(superclass, ClassQuery.EXACT, bar, true);
+ // Should be false since the class is not directly instantiated:
+ check(superclass, ClassQuery.EXACT, baz, true);
check(superclass, ClassQuery.SUBCLASS, foo, false);
- check(superclass, ClassQuery.SUBCLASS, bar, false);
+ // Should be false since all live subclasses have a concrete implementation:
+ check(superclass, ClassQuery.SUBCLASS, bar, true);
check(superclass, ClassQuery.SUBCLASS, baz, true);
check(superclass, ClassQuery.SUBTYPE, foo, false);
- check(superclass, ClassQuery.SUBTYPE, bar, false);
+ // Should be false since all live subtypes have a concrete implementation:
+ check(superclass, ClassQuery.SUBTYPE, bar, true);
check(superclass, ClassQuery.SUBTYPE, baz, true);
check(subclass, ClassQuery.EXACT, foo, false);
@@ -259,13 +258,17 @@ testClassSets() async {
Expect.isTrue(closedWorld.isImplemented(subtype));
check(superclass, ClassQuery.EXACT, foo, false);
- check(superclass, ClassQuery.EXACT, bar, false);
- check(superclass, ClassQuery.EXACT, baz, false);
+ // Should be false since the class is not directly instantiated:
+ check(superclass, ClassQuery.EXACT, bar, true);
+ // Should be false since the class is not directly instantiated:
+ check(superclass, ClassQuery.EXACT, baz, true);
check(superclass, ClassQuery.SUBCLASS, foo, false);
- check(superclass, ClassQuery.SUBCLASS, bar, false);
+ // Should be false since all live subclasses have a concrete implementation:
+ check(superclass, ClassQuery.SUBCLASS, bar, true);
check(superclass, ClassQuery.SUBCLASS, baz, true);
check(superclass, ClassQuery.SUBTYPE, foo, true);
- check(superclass, ClassQuery.SUBTYPE, bar, false);
+ // Should be false since all live subtypes have a concrete implementation:
+ check(superclass, ClassQuery.SUBTYPE, bar, true);
check(superclass, ClassQuery.SUBTYPE, baz, true);
check(subclass, ClassQuery.EXACT, foo, false);
« no previous file with comments | « pkg/compiler/lib/src/world.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698