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

Unified Diff: pkg/front_end/lib/src/fasta/target_implementation.dart

Issue 2781493002: Throw AbstractClassInstantiationError on abstract classes. (Closed)
Patch Set: Update co19 status. Created 3 years, 9 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 | « pkg/front_end/lib/src/fasta/loader.dart ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/target_implementation.dart
diff --git a/pkg/front_end/lib/src/fasta/target_implementation.dart b/pkg/front_end/lib/src/fasta/target_implementation.dart
index 45a105f4ca7e466e2cbad8e196db6368a875a6c7..d702e6e7473b41879e437a776ef016c0f0500046 100644
--- a/pkg/front_end/lib/src/fasta/target_implementation.dart
+++ b/pkg/front_end/lib/src/fasta/target_implementation.dart
@@ -20,6 +20,7 @@ import 'translate_uri.dart' show TranslateUri;
abstract class TargetImplementation extends Target {
final TranslateUri uriTranslator;
Builder cachedCompileTimeError;
+ Builder cachedAbstractClassInstantiationError;
Builder cachedNativeAnnotation;
TargetImplementation(Ticker ticker, this.uriTranslator) : super(ticker);
@@ -50,6 +51,18 @@ abstract class TargetImplementation extends Target {
loader.coreLibrary.getConstructor("_CompileTimeError", isPrivate: true);
}
+ /// Returns a reference to the constructor of
+ /// [AbstractClassInstantiationError] error. The constructor is expected to
+ /// accept a single argument of type String, which is the name of the
+ /// abstract class.
+ Builder getAbstractClassInstantiationError(Loader loader) {
+ if (cachedAbstractClassInstantiationError != null) {
+ return cachedAbstractClassInstantiationError;
+ }
+ return cachedAbstractClassInstantiationError =
+ loader.coreLibrary.getConstructor("AbstractClassInstantiationError");
+ }
+
/// Returns a reference to the constructor used for creating `native`
/// annotations. The constructor is expected to accept a single argument of
/// type String, which is the name of the native method.
« no previous file with comments | « pkg/front_end/lib/src/fasta/loader.dart ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698