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

Unified Diff: runtime/vm/parser.cc

Issue 23453024: Keep track of type parameter processing in mixin application classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 27156)
+++ runtime/vm/parser.cc (working copy)
@@ -2400,7 +2400,7 @@
// expressions and then calls the respective super constructor with
// the same name and number of parameters.
ArgumentListNode* forwarding_args = NULL;
- if (current_class().mixin() != Type::null()) {
+ if (current_class().IsMixinApplication()) {
// At this point we don't support forwarding constructors
// that have optional parameters because we don't know the default
// values of the optional parameters. We would have to compile the super
@@ -2911,7 +2911,7 @@
*(qual_ident->ident),
NULL)) {
LibraryPrefix& lib_prefix = LibraryPrefix::ZoneHandle();
- if (current_class().mixin() == Type::null()) {
+ if (!current_class().IsMixinApplication()) {
lib_prefix = current_class().LookupLibraryPrefix(*(qual_ident->ident));
} else {
// TODO(hausner): Should we resolve the prefix via the library scope
@@ -8714,7 +8714,7 @@
// If the current class is the result of a mixin application, we must
// use the class scope of the class from which the function originates.
Class& cls = Class::Handle(isolate());
- if (current_class().mixin() == Type::null()) {
+ if (!current_class().IsMixinApplication()) {
cls = current_class().raw();
} else {
cls = parsed_function()->function().origin();
@@ -10137,12 +10137,12 @@
ErrorMsg("class '%s' does not have a superclass",
String::Handle(current_class().Name()).ToCString());
}
- if (current_class().mixin() != Type::null()) {
+ if (current_class().IsMixinApplication()) {
const Type& mixin_type = Type::Handle(current_class().mixin());
if (mixin_type.type_class() == current_function().origin()) {
- ErrorMsg("class '%s' may not use super "
- "because it is used as mixin class",
- String::Handle(current_class().Name()).ToCString());
+ ErrorMsg("method of mixin class '%s' may not refer to 'super'",
+ String::Handle(Class::Handle(
+ current_function().origin()).Name()).ToCString());
}
}
ConsumeToken();
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698