File tree 3 files changed +19
-1
lines changed
compiler/src/dotty/tools/dotc/reporting
3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -1386,7 +1386,11 @@ import transform.SymUtils._
1386
1386
1387
1387
class TypeDoesNotTakeParameters (tpe : Type , params : List [Trees .Tree [Trees .Untyped ]])(using Context )
1388
1388
extends TypeMsg (TypeDoesNotTakeParametersID ) {
1389
- def msg = em " $tpe does not take type parameters "
1389
+ private def fboundsAddendum =
1390
+ if tpe.typeSymbol.isAllOf(Provisional | TypeParam ) then
1391
+ " \n (Note that F-bounds of type parameters may not be type lambdas)"
1392
+ else " "
1393
+ def msg = em " $tpe does not take type parameters $fboundsAddendum"
1390
1394
def explain =
1391
1395
val ps =
1392
1396
if (params.size == 1 ) s " a type parameter ${params.head}"
Original file line number Diff line number Diff line change
1
+ -- [E053] Type Error: tests/neg/i8752.scala:3:41 -----------------------------------------------------------------------
2
+ 3 |trait Arround1[C <:[X]=>>IterableOps[X,C,C[X]] ] // error // error
3
+ | ^^^^
4
+ | C does not take type parameters
5
+ | (Note that F-bounds of type parameters may not be type lambdas)
6
+
7
+ longer explanation available when compiling with `-explain`
8
+ -- Error: tests/neg/i8752.scala:3:39 -----------------------------------------------------------------------------------
9
+ 3 |trait Arround1[C <:[X]=>>IterableOps[X,C,C[X]] ] // error // error
10
+ | ^
11
+ | Type argument C does not have the same kind as its bound [_]
Original file line number Diff line number Diff line change
1
+ import scala .collection .IterableOps
2
+
3
+ trait Arround1 [C <: [X ]=>> IterableOps [X ,C ,C [X ]] ] // error // error
You can’t perform that action at this time.
0 commit comments