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 01447df commit 982f21aCopy full SHA for 982f21a
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -2736,7 +2736,10 @@ object Types extends TypeUtils {
2736
while (tparams.nonEmpty && args.nonEmpty) {
2737
if (tparams.head.eq(tparam))
2738
return args.head match {
2739
- case _: TypeBounds if !widenAbstract => TypeRef(pre, tparam)
+ case _: TypeBounds if !widenAbstract =>
2740
+ if !NamedType.validPrefix(pre) then
2741
+ throw TypeError(em"invalid prefix $pre cannot replace parameter $tparam in result of selection")
2742
+ TypeRef(pre, tparam)
2743
case arg => arg
2744
}
2745
tparams = tparams.tail
tests/neg/i23504.scala
@@ -0,0 +1,2 @@
1
+def test =
2
+ Seq.empty[[T] =>> () => ?].head() // error
0 commit comments