Index: pkg/kernel/lib/ast.dart |
diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart |
index fa2d18086786c490994e0d73ab078909a8e60dbc..72ab24dc7fb1254fbc1a7a137b64738752b29b35 100644 |
--- a/pkg/kernel/lib/ast.dart |
+++ b/pkg/kernel/lib/ast.dart |
@@ -4103,10 +4103,21 @@ class NamedType extends Node implements Comparable<NamedType> { |
final Map<TypeParameter, int> _temporaryHashCodeTable = <TypeParameter, int>{}; |
/// Reference to a type variable. |
+/// |
+/// A type variable has an optional bound because type promotion can change the |
+/// bound. A bound of `null` indicates that the bound has not been promoted and |
+/// is the same as the [TypeParameter]'s bound. This allows one to detect |
+/// whether the bound has been promoted. |
class TypeParameterType extends DartType { |
TypeParameter parameter; |
- TypeParameterType(this.parameter); |
+ /// An optional promoted bound on the type parameter. |
+ /// |
+ /// 'null' indicates that the type parameter's bound has not been promoted and |
+ /// is therefore the same as the bound of [parameter]. |
+ DartType bound; |
+ |
+ TypeParameterType(this.parameter, [this.bound]); |
accept(DartTypeVisitor v) => v.visitTypeParameterType(this); |