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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_types.dart

Issue 12082051: Perform substitution on the unaliased type of a typedef. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment Created 7 years, 11 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 | « no previous file | tests/compiler/dart2js/type_substitution_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/dart_types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_types.dart b/sdk/lib/_internal/compiler/implementation/dart_types.dart
index 285ef1a3e0c6aebbf61faa528a763205f76d1057..b43de387745253218013dbe7fd928b52fce58523 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart
@@ -622,8 +622,9 @@ class TypedefType extends DartType {
DartType unalias(Compiler compiler) {
// TODO(ahe): This should be [ensureResolved].
compiler.resolveTypedef(element);
- // TODO(johnniwinther): Perform substitution on the unaliased type.
- return element.alias.unalias(compiler);
+ DartType definition = element.alias.unalias(compiler);
+ TypedefType declaration = element.computeType(compiler);
+ return definition.subst(typeArguments, declaration.typeArguments);
}
String toString() {
« no previous file with comments | « no previous file | tests/compiler/dart2js/type_substitution_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698