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

Unified Diff: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart

Issue 2574193003: Support generic methods in kernel (Closed)
Patch Set: Cleanup Created 4 years 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/resolution/members.dart ('k') | tests/compiler/dart2js/kernel/impact_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
diff --git a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
index 3c85ff073254ae904a1e80ac34864caacfd91184..9bc53bd6bff3d5b58d98b84bec5bf3d048c5cfd9 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -747,9 +747,14 @@ class DartTypeConverter extends ir.DartTypeVisitor<DartType> {
} else if (node.parameter.parent is ir.FunctionNode) {
ir.FunctionNode func = node.parameter.parent;
int index = func.typeParameters.indexOf(node.parameter);
- ConstructorElement constructorElement = astAdapter.getElement(func);
- ClassElement classElement = constructorElement.enclosingClass;
- return classElement.typeVariables[index];
+ Element element = astAdapter.getElement(func);
+ if (element.isConstructor) {
+ ClassElement classElement = element.enclosingClass;
+ return classElement.typeVariables[index];
+ } else {
+ GenericElement genericElement = element;
+ return genericElement.typeVariables[index];
+ }
}
throw new UnsupportedError('Unsupported type parameter type node $node.');
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | tests/compiler/dart2js/kernel/impact_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698