File tree 4 files changed +17
-1
lines changed
compiler/src/dotty/tools/dotc/typer
4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ trait Deriving {
160
160
val clsParamInfos = clsType.typeParams
161
161
val clsArity = clsParamInfos.length
162
162
val alignedClsParamInfos = clsParamInfos.takeRight(instanceArity)
163
- val alignedTypeClassParamInfos = typeClassParamInfos.take (alignedClsParamInfos.length)
163
+ val alignedTypeClassParamInfos = typeClassParamInfos.takeRight (alignedClsParamInfos.length)
164
164
165
165
166
166
if ((instanceArity == clsArity || instanceArity > 0 ) && sameParamKinds(alignedClsParamInfos, alignedTypeClassParamInfos)) {
Original file line number Diff line number Diff line change
1
+ -- Error: tests/neg/i13487.scala:6:32 ----------------------------------------------------------------------------------
2
+ 6 |case class Foo[A](a: A) derives TC // error
3
+ | ^^
4
+ | Foo cannot be unified with the type argument of TC
Original file line number Diff line number Diff line change
1
+ trait TC [F [_, _[_]]]
2
+ object TC {
3
+ def derived [F [_, _[_]]]: TC [F ] = ???
4
+ }
5
+
6
+ case class Foo [A ](a : A ) derives TC // error
Original file line number Diff line number Diff line change
1
+ trait TC [F [_[_], _]]
2
+ object TC {
3
+ def derived [F [_[_], _]]: TC [F ] = ???
4
+ }
5
+
6
+ case class Foo [A ](a : A ) derives TC
You can’t perform that action at this time.
0 commit comments