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

Unified Diff: pkg/compiler/lib/src/compile_time_constants.dart

Issue 2001393003: Revision of "Adjusts dart2js backend to handle method type arguments" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/commandline_options.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compile_time_constants.dart
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index 9a52c3ec1154f6b0ca83ba5f8ddbca372869ec7c..c2d39d4e9ba59dca9a28a7bcaf3194c3f41c3b89 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -246,9 +246,17 @@ abstract class ConstantCompilerBase implements ConstantCompiler {
ConstantValue value = getConstantValue(expression);
if (elementType.isMalformed && !value.isNull) {
if (isConst) {
- ErroneousElement element = elementType.element;
- reporter.reportErrorMessage(
- node, element.messageKind, element.messageArguments);
+ // TODO(johnniwinther): Check that it is possible to reach this
+ // point in a situation where `elementType is! MalformedType`.
+ if (elementType is MalformedType) {
+ ErroneousElement element = elementType.element;
+ reporter.reportErrorMessage(
+ node, element.messageKind, element.messageArguments);
+ } else {
+ assert(elementType is MethodTypeVariableType);
+ reporter.reportErrorMessage(
+ node, MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED);
+ }
} else {
// We need to throw an exception at runtime.
expression = null;
« no previous file with comments | « pkg/compiler/lib/src/commandline_options.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698