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

Unified Diff: pkg/compiler/lib/src/resolution/constructors.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/js_backend/runtime_types.dart ('k') | pkg/compiler/lib/src/resolution/signatures.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/constructors.dart
diff --git a/pkg/compiler/lib/src/resolution/constructors.dart b/pkg/compiler/lib/src/resolution/constructors.dart
index 17bd6e030d29d0abb2d2515352645776a7dba8ce..7a4dbc68af735d296d314058213cbcc0a99162b1 100644
--- a/pkg/compiler/lib/src/resolution/constructors.dart
+++ b/pkg/compiler/lib/src/resolution/constructors.dart
@@ -719,7 +719,17 @@ class ConstructorResolver extends CommonResolverVisitor<ConstructorResult> {
ConstructorResult constructorResultForType(Node node, DartType type,
{PrefixElement prefix}) {
String name = type.name;
- if (type.isMalformed) {
+ if (type.isTypeVariable) {
+ return reportAndCreateErroneousConstructorElement(
+ node,
+ ConstructorResultKind.INVALID_TYPE,
+ type,
+ resolver.enclosingElement,
+ name,
+ MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE,
+ {'typeVariableName': name});
+ } else if (type.isMalformed) {
+ // `type is MalformedType`: `MethodTypeVariableType` is handled above.
return new ConstructorResult.forError(
ConstructorResultKind.INVALID_TYPE, type.element, type);
} else if (type.isInterfaceType) {
@@ -733,15 +743,6 @@ class ConstructorResolver extends CommonResolverVisitor<ConstructorResult> {
name,
MessageKind.CANNOT_INSTANTIATE_TYPEDEF,
{'typedefName': name});
- } else if (type.isTypeVariable) {
- return reportAndCreateErroneousConstructorElement(
- node,
- ConstructorResultKind.INVALID_TYPE,
- type,
- resolver.enclosingElement,
- name,
- MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE,
- {'typeVariableName': name});
}
return reporter.internalError(node, "Unexpected constructor type $type");
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/runtime_types.dart ('k') | pkg/compiler/lib/src/resolution/signatures.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698