Open martijnhoekstra opened 6 years ago
maybe fixed by https://github.com/scala/scala/pull/6069
I can't verify due to my personal incompetence with the sbt runner (
> scalac -Xsource:2.13 ./sandbox/test.scala
[error] Expected non-whitespace character
)
it compiles in 2.12.3 (and 2.12.17)
but then 2.13.10 gives:
On line 8: error: inferred kinds of the type arguments (AnyVal) do not conform to the expected kinds of the type parameters (type F).
AnyVal's type parameters do not match type F's expected parameters:
class AnyVal has no type parameters, but type F has one
val baz = Baz(l) //infers Baz[Any]
^
On line 8: error: type mismatch;
found : List[Option[Int]]
required: F[Int]
val bur = Baz(l3) //infers Baz[Any] again
^
and Scala 3.3.0-RC3 agrees:
8 | val baz = Baz(l) //infers Baz[Any]
| ^
|Found: (Foo.l : List[Option[Int]])
|Required: F[Int]
|
|where: F is a type variable with constraint <: [_] =>> Any
val l: List[Option[Int]] = Foo.baz
should compile but givespossibly related to https://github.com/scala/bug/issues/5075 ?
reproduced in 2.12.3
in dotty the error is
repro: https://scastie.scala-lang.org/martijnhoekstra/k9RFNIjCQk2pcI5vvanzow