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

Unified Diff: runtime/lib/error.dart

Issue 10916039: Throw AbstractClassInstantiationError if an abstract class is instantiated (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
Index: runtime/lib/error.dart
===================================================================
--- runtime/lib/error.dart (revision 11639)
+++ runtime/lib/error.dart (working copy)
@@ -107,3 +107,25 @@
final int line;
final int column;
}
+
+
+class AbstractClassInstantiationErrorImplementation
+ implements AbstractClassInstantiationError {
+
+ factory AbstractClassInstantiationErrorImplementation._uninstantiable() {
+ throw const UnsupportedOperationException(
+ "AbstractClassInstantiationError can only be allocated by the VM");
+ }
+
+ static _throwNew(int case_clause_pos, String className)
+ native "AbstractClassInstantiationError_throwNew";
+
+ String toString() {
+ return "Cannot instantiate abstract class $className: "
+ "url '$url' line $line";
+ }
+
+ final String className;
+ final String url;
+ final int line;
+}

Powered by Google App Engine
This is Rietveld 408576698