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

Unified Diff: runtime/lib/mirrors.cc

Issue 114593002: VM: Match language error when attempting to reflectively instantiate an abstract class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync Created 7 years 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/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 59d95bcd02556629238c5156af26a709dd6ae34a..3f7e05828a67d710b649e4d35ea279ff8cd00ca1 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -1712,6 +1712,16 @@ DEFINE_NATIVE_ENTRY(ClassMirror_invokeConstructor, 5) {
UNREACHABLE();
}
+ if (klass.is_abstract() && !lookup_constructor.IsFactory()) {
+ const Array& error_args = Array::Handle(Array::New(3));
+ error_args.SetAt(0, klass_name);
+ // 1 = script url
+ // 2 = token position
+ Exceptions::ThrowByType(Exceptions::kAbstractClassInstantiation,
+ error_args);
+ UNREACHABLE();
+ }
+
ASSERT(!type.IsNull());
AbstractTypeArguments& type_arguments =
AbstractTypeArguments::Handle(type.arguments());
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698