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

Unified Diff: pkg/compiler/lib/src/elements/resolution_types.dart

Issue 2616653003: Use elements/types.dart in codegen.dart (Closed)
Patch Set: dartfmt Created 3 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 | pkg/compiler/lib/src/elements/types.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/resolution_types.dart
diff --git a/pkg/compiler/lib/src/elements/resolution_types.dart b/pkg/compiler/lib/src/elements/resolution_types.dart
index 785a27193d494b1d356ca392d10daa3bac10c642..8168305002430977a8f442fe3f88514389adf392 100644
--- a/pkg/compiler/lib/src/elements/resolution_types.dart
+++ b/pkg/compiler/lib/src/elements/resolution_types.dart
@@ -356,7 +356,7 @@ class MalformedType extends DartType {
}
}
-abstract class GenericType extends DartType {
+abstract class GenericType<T extends GenericType> extends DartType {
final TypeDeclarationElement element;
final List<DartType> typeArguments;
@@ -381,9 +381,9 @@ abstract class GenericType extends DartType {
}
/// Creates a new instance of this type using the provided type arguments.
- GenericType createInstantiation(List<DartType> newTypeArguments);
+ T createInstantiation(List<DartType> newTypeArguments);
- DartType subst(List<DartType> arguments, List<DartType> parameters) {
+ T subst(List<DartType> arguments, List<DartType> parameters) {
if (typeArguments.isEmpty) {
// Return fast on non-generic types.
return this;
@@ -471,7 +471,8 @@ abstract class GenericType extends DartType {
}
}
-class InterfaceType extends GenericType implements types.InterfaceType {
+class InterfaceType extends GenericType<InterfaceType>
+ implements types.InterfaceType {
int _hashCode;
InterfaceType(ClassElement element,
@@ -809,7 +810,7 @@ class FunctionType extends DartType implements types.FunctionType {
bool _typeContainsMethodTypeVariableType(DartType type) =>
type.containsMethodTypeVariableType;
-class TypedefType extends GenericType {
+class TypedefType extends GenericType<TypedefType> {
DartType _unaliased;
TypedefType(TypedefElement element,
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698