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

Unified Diff: pkg/compiler/lib/src/types/constants.dart

Issue 1383483006: Extract DiagnosticReporter implementation from Compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes after rebase. Created 5 years, 2 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/compiler/lib/src/typechecker.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/types/constants.dart
diff --git a/pkg/compiler/lib/src/types/constants.dart b/pkg/compiler/lib/src/types/constants.dart
index e036901ba6edc3d4a99ef020bad85767bd3a009f..0a303d4299915cd3bb374661866c15b8f0c36b6f 100644
--- a/pkg/compiler/lib/src/types/constants.dart
+++ b/pkg/compiler/lib/src/types/constants.dart
@@ -7,8 +7,13 @@ library types.constants;
import '../compiler.dart' show
Compiler;
import '../constants/values.dart';
+import '../diagnostics/diagnostic_listener.dart' show
+ DiagnosticReporter;
+import '../diagnostics/spannable.dart' show
+ CURRENT_ELEMENT_SPANNABLE;
+import '../js_backend/js_backend.dart' show
+ SyntheticConstantKind;
import 'types.dart';
-import '../js_backend/js_backend.dart' show SyntheticConstantKind;
/// Computes the [TypeMask] for the constant [value].
TypeMask computeTypeMask(Compiler compiler, ConstantValue value) {
@@ -58,7 +63,8 @@ class ConstantValueTypeMasks extends ConstantValueVisitor<TypeMask, Compiler> {
case SyntheticConstantKind.NAME:
return compiler.typesTask.stringType;
default:
- compiler.internalError(compiler.currentElement,
+ DiagnosticReporter reporter = compiler.reporter;
+ reporter.internalError(CURRENT_ELEMENT_SPANNABLE,
"Unexpected DummyConstantKind.");
return null;
}
« no previous file with comments | « pkg/compiler/lib/src/typechecker.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698