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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 15888009: Fix http://dartbug.com/8669 by making sure we do not crash when trying to use Object as a mixin. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index ae787bed30938ecd494655ab1a7b62fc540611b1..4063da313655a9e3f35515d13fb693b996e2adc2 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -106,10 +106,10 @@ class TreeElementMapping implements TreeElements {
return selectors[node.assignmentOperator];
}
- // The following methods set selectors on the "for in" node. Since
- // we're using three selectors, we need to use children of the node,
- // and we arbitrarily choose which ones.
-
+ // The following methods set selectors on the "for in" node. Since
+ // we're using three selectors, we need to use children of the node,
+ // and we arbitrarily choose which ones.
ngeoffray 2013/05/30 06:53:01 Thank you :)
+
Selector setIteratorSelector(ForIn node, Selector selector) {
selectors[node] = selector;
}
@@ -121,7 +121,7 @@ class TreeElementMapping implements TreeElements {
Selector setMoveNextSelector(ForIn node, Selector selector) {
selectors[node.forToken] = selector;
}
-
+
Selector getMoveNextSelector(ForIn node) {
return selectors[node.forToken];
}
@@ -602,6 +602,14 @@ class ResolverTask extends CompilerTask {
ClassElement mixin = mixinApplication.mixin;
if (mixin == null) return;
+ // Check that we're not trying to use Object as a mixin.
+ if (mixin.superclass == null) {
+ compiler.reportErrorCode(mixinApplication,
+ MessageKind.ILLEGAL_MIXIN_OBJECT);
+ // Avoid reporting additional errors for the Object class.
ngeoffray 2013/05/30 06:53:01 I'd drop "for the Object class", it confused me.
+ return;
+ }
+
// Check that the mixed in class has Object as its superclass.
if (!mixin.superclass.isObject(compiler)) {
compiler.reportErrorCode(mixin, MessageKind.ILLEGAL_MIXIN_SUPERCLASS);
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698