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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 1588723002: Allow super type to be malformed (fixes issue 25426). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: safer alternative fix Created 4 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 | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 8ef3511c611dac6c57f9c0cc6ec2e40eced3fbdd..0361c038d19dc56fa355c63e954c3bd16608c6bb 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -2659,6 +2659,14 @@ RawType* ClassFinalizer::ResolveMixinAppType(
AbstractType::Handle(zone, mixin_app_type.super_type());
ResolveType(cls, mixin_super_type);
ASSERT(mixin_super_type.HasResolvedTypeClass()); // Even if malformed.
+ if (mixin_super_type.IsMalformedOrMalbounded()) {
+ ReportError(Error::Handle(zone, mixin_super_type.error()));
+ }
+ if (mixin_super_type.IsDynamicType()) {
+ ReportError(cls, cls.token_pos(),
+ "class '%s' may not extend 'dynamic'",
+ String::Handle(zone, cls.Name()).ToCString());
+ }
// The super type may have a BoundedType as type argument, but cannot be
// a BoundedType itself.
CollectTypeArguments(cls, Type::Cast(mixin_super_type), type_args);
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698