File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2682,8 +2682,11 @@ object Types extends TypeUtils {
2682
2682
while (tparams.nonEmpty && args.nonEmpty) {
2683
2683
if (tparams.head.eq(tparam))
2684
2684
return args.head match {
2685
- case _ : TypeBounds if ! widenAbstract => TypeRef (pre, tparam)
2686
- case arg => arg.boxedUnlessFun(tycon)
2685
+ case _ : TypeBounds if ! widenAbstract =>
2686
+ if ! NamedType .validPrefix(pre) then
2687
+ throw TypeError (em " invalid prefix $pre cannot replace parameter $tparam in result of selection " )
2688
+ TypeRef (pre, tparam)
2689
+ case arg => arg
2687
2690
}
2688
2691
tparams = tparams.tail
2689
2692
args = args.tail
Original file line number Diff line number Diff line change
1
+ def test =
2
+ Seq .empty[[T ] =>> () => ? ].head() // error
You can’t perform that action at this time.
0 commit comments