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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart

Issue 48383003: Support checking of malbounded types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 7 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
Index: sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
index 5644edba756093572b1f14daff97913227b01679..0a578efb9a83e2ed71e0451e0f72c9ce93f718b8 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
@@ -235,9 +235,10 @@ class TypeTestEmitter extends CodeEmitterHelper {
Map<FunctionType, bool> getFunctionTypeChecksOn(DartType type) {
Map<FunctionType, bool> functionTypeMap = new Map<FunctionType, bool>();
for (FunctionType functionType in checkedFunctionTypes) {
- if (compiler.types.isSubtype(type, functionType)) {
+ int maybeSubtype = compiler.types.computeSubtypeRelation(type, functionType);
+ if (maybeSubtype == Types.IS_SUBTYPE) {
functionTypeMap[functionType] = true;
- } else if (compiler.types.isPotentialSubtype(type, functionType)) {
+ } else if (maybeSubtype == Types.MAYBE_SUBTYPE) {
functionTypeMap[functionType] = false;
}
}

Powered by Google App Engine
This is Rietveld 408576698