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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder.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
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
index dd756c69567adf7090c5dd40509a9834040a7efa..3e1f9bf0d1edc78bc3dfa25d60f1b2fb22941e1c 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -2734,10 +2734,18 @@ class IrBuilder {
type = program.unaliasType(type);
if (type.isMalformed) {
- ErroneousElement element = type.element;
- ir.Primitive message = buildStringConstant(element.message);
+ String message;
+ if (type is MalformedType) {
+ ErroneousElement element = type.element;
+ message = element.message;
+ } else {
+ assert(type is MethodTypeVariableType);
+ message = "Method type variables are not reified, "
+ "so they cannot be tested dynamically";
+ }
+ ir.Primitive irMessage = buildStringConstant(message);
return buildStaticFunctionInvocation(program.throwTypeErrorHelper,
- <ir.Primitive>[message], sourceInformation);
+ <ir.Primitive>[irMessage], sourceInformation);
}
List<ir.Primitive> typeArguments = const <ir.Primitive>[];
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698