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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart

Issue 147743005: classes with call-methods were not recognized as Functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to update analyzer2 status file. Created 6 years, 11 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/types/flat_type_mask.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart b/sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart
index 1938dfc58aec14c0abb81a11fa3369f9633a1808..3cf1dbf6e9ef3802c7868e86624e31b78b853e40 100644
--- a/sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart
@@ -603,7 +603,12 @@ class FlatTypeMask implements TypeMask {
static bool isSubtypeOf(ClassElement x, ClassElement y, Compiler compiler) {
assert(x.isDeclaration && y.isDeclaration);
Set<ClassElement> subtypes = compiler.world.subtypesOf(y);
- return (subtypes != null) ? subtypes.contains(x) : false;
+ if (subtypes != null && subtypes.contains(x)) return true;
+ if (y != compiler.functionClass) return false;
+ // TODO(johnniwinther): Clean this up (function inheritance).
+ Member member =
+ x.lookupInterfaceMember(const PublicName(Compiler.CALL_OPERATOR_NAME));
+ return member != null && member.isMethod;
}
static Set<ClassElement> commonContainedClasses(FlatTypeMask x,
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/elements/elements.dart ('k') | tests/language/function_propagation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698