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 baa845b commit 76524fbCopy full SHA for 76524fb
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -4006,7 +4006,16 @@ object Types {
4006
else pre match {
4007
case Range(preLo, preHi) =>
4008
val forwarded =
4009
- if (tp.symbol.is(ClassTypeParam)) tp.argForParam(preHi)
+ if (tp.symbol.is(ClassTypeParam)) {
4010
+ tp.argForParam(preHi) match {
4011
+ case arg: TypeArgRef =>
4012
+ arg.underlying match {
4013
+ case TypeBounds(lo, hi) => range(atVariance(-variance)(reapply(lo)), reapply(hi))
4014
+ case arg => reapply(arg)
4015
+ }
4016
4017
4018
4019
else tryWiden(tp, preHi)
4020
forwarded.orElse(
4021
range(super.derivedSelect(tp, preLo), super.derivedSelect(tp, preHi)))
0 commit comments