File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -197,14 +197,20 @@ final class ProperGadtConstraint private(
197
197
case null =>
198
198
val res = {
199
199
import NameKinds .DepParamName
200
+ // For symbols standing for HK types, we need to preserve the kind information
201
+ // (see also usage of adaptHKvariances above)
202
+ // Ideally we'd always preserve the bounds,
203
+ // but first we need an equivalent of ConstraintHandling#addConstraint
204
+ // TODO: implement the above
205
+ val initialBounds = sym.info match {
206
+ case tb @ TypeBounds (_, hi) if hi.isLambdaSub => tb
207
+ case _ => TypeBounds .empty
208
+ }
200
209
// avoid registering the TypeVar with TyperState / TyperState#constraint
201
210
// - we don't want TyperState instantiating these TypeVars
202
211
// - we don't want TypeComparer constraining these TypeVars
203
212
val poly = PolyType (DepParamName .fresh(sym.name.toTypeName) :: Nil )(
204
- pt => (sym.info match {
205
- case tb @ TypeBounds (_, hi) if hi.isLambdaSub => tb
206
- case _ => TypeBounds .empty
207
- }) :: Nil ,
213
+ pt => initialBounds :: Nil ,
208
214
pt => defn.AnyType )
209
215
new TypeVar (poly.paramRefs.head, creatorState = null )
210
216
}
You can’t perform that action at this time.
0 commit comments