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

Unified Diff: pkg/compiler/lib/src/resolution/resolution.dart

Issue 2112503002: Implement super in mixins. (Closed) Base URL: sso://user/ahe/dart-sdk@malformed
Patch Set: Remove experimenting code. Created 4 years, 6 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/resolution/class_hierarchy.dart ('k') | pkg/compiler/lib/src/resolution/scope.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/resolution.dart
diff --git a/pkg/compiler/lib/src/resolution/resolution.dart b/pkg/compiler/lib/src/resolution/resolution.dart
index 66bd06781a7967552cbd69b5a48b5fc2b53889e9..3f63653a9a95d2ec965acb2c61dd03cefb1bf333 100644
--- a/pkg/compiler/lib/src/resolution/resolution.dart
+++ b/pkg/compiler/lib/src/resolution/resolution.dart
@@ -58,6 +58,9 @@ import 'signatures.dart';
import 'tree_elements.dart';
import 'typedefs.dart';
+// TODO(ahe): This should be a compiler option or something like that.
+const bool allowSuperInMixin = true;
+
class ResolverTask extends CompilerTask {
final ConstantCompiler constantCompiler;
@@ -263,7 +266,7 @@ class ResolverTask extends CompilerTask {
// application has been performed.
TreeElements resolutionTree = registry.mapping;
ClassElement enclosingClass = element.enclosingClass;
- if (enclosingClass != null) {
+ if (!allowSuperInMixin && enclosingClass != null) {
// TODO(johnniwinther): Find another way to obtain mixin uses.
Iterable<MixinApplicationElement> mixinUses =
compiler.world.allMixinUsesOf(enclosingClass);
@@ -726,7 +729,7 @@ class ResolverTask extends CompilerTask {
if (member.isGenerativeConstructor && !member.isSynthesized) {
reporter.reportErrorMessage(
member, MessageKind.ILLEGAL_MIXIN_CONSTRUCTOR);
- } else {
+ } else if (!allowSuperInMixin) {
// Get the resolution tree and check that the resolved member
// doesn't use 'super'. This is the part of the 'super' mixin
// check that happens when a function is resolved before the
« no previous file with comments | « pkg/compiler/lib/src/resolution/class_hierarchy.dart ('k') | pkg/compiler/lib/src/resolution/scope.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698