We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3c0aaf commit 4f1227eCopy full SHA for 4f1227e
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -4000,7 +4000,16 @@ object Types {
4000
else pre match {
4001
case Range(preLo, preHi) =>
4002
val forwarded =
4003
- if (tp.symbol.is(ClassTypeParam)) tp.argForParam(preHi)
+ if (tp.symbol.is(ClassTypeParam)) {
4004
+ tp.argForParam(preHi) match {
4005
+ case arg: TypeArgRef =>
4006
+ arg.underlying match {
4007
+ case TypeBounds(lo, hi) => range(atVariance(-variance)(reapply(lo)), reapply(hi))
4008
+ case arg => reapply(arg)
4009
+ }
4010
4011
4012
4013
else tryWiden(tp, preHi)
4014
forwarded.orElse(
4015
range(super.derivedSelect(tp, preLo), super.derivedSelect(tp, preHi)))
0 commit comments