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

Unified Diff: sdk/lib/_internal/compiler/implementation/world.dart

Issue 12033049: Disallow mixing in classes that use 'super'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge from master. Created 7 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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/warnings.dart ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/world.dart
diff --git a/sdk/lib/_internal/compiler/implementation/world.dart b/sdk/lib/_internal/compiler/implementation/world.dart
index 9cdaea8251d52fe3751e213fc0ddeeb5f9c3e085..a40050ee801e7910e496a722dcb0bc2c4156d50c 100644
--- a/sdk/lib/_internal/compiler/implementation/world.dart
+++ b/sdk/lib/_internal/compiler/implementation/world.dart
@@ -7,6 +7,7 @@ part of dart2js;
class World {
final Compiler compiler;
final Map<ClassElement, Set<ClassElement>> subtypes;
+ final Map<ClassElement, Set<MixinApplicationElement>> mixinUses;
final Map<ClassElement, Set<ClassElement>> typesImplementedBySubclasses;
final Set<ClassElement> classesNeedingRti;
final Map<ClassElement, Set<ClassElement>> rtiDependencies;
@@ -15,6 +16,7 @@ class World {
World(Compiler compiler)
: subtypes = new Map<ClassElement, Set<ClassElement>>(),
+ mixinUses = new Map<ClassElement, Set<MixinApplicationElement>>(),
typesImplementedBySubclasses =
new Map<ClassElement, Set<ClassElement>>(),
userDefinedGetters = new FunctionSet(compiler),
@@ -93,6 +95,14 @@ class World {
return classesNeedingRti.contains(cls) || compiler.enabledRuntimeType;
}
+ void registerMixinUse(MixinApplicationElement mixinApplication,
+ ClassElement mixin) {
+ Set<MixinApplicationElement> users =
+ mixinUses.putIfAbsent(mixin, () =>
+ new Set<MixinApplicationElement>());
+ users.add(mixinApplication);
+ }
+
void registerRtiDependency(Element element, Element dependency) {
// We're not dealing with typedef for now.
if (!element.isClass() || !dependency.isClass()) return;
@@ -133,8 +143,6 @@ class World {
return subclasses == null || subclasses.isEmpty;
}
-
-
void registerUsedElement(Element element) {
if (element.isMember()) {
if (element.isGetter()) {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/warnings.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698