Closed mrdziuban closed 9 months ago
Scala version: 2.13.12
With -Xsource:3 and -quickfix:any, this code is rewritten:
-Xsource:3
-quickfix:any
sealed trait Foo trait HasFoo[A] { def getFoo(a: A): Foo } object HasFoo { implicit def fromFoo[F <: Foo]: HasFoo[F] = new HasFoo[F] { def getFoo(f: F) = f } }
to this:
sealed trait Foo trait HasFoo[A] { def getFoo(a: A): Foo } object HasFoo { implicit def fromFoo[F <: Foo]: HasFoo[F] = new HasFoo[F] { def getFoo: F(f: F) = f } }
Note that def getFoo in the fromFoo instance has its return type annotated before its parameter list
def getFoo
fromFoo
Whoops, just noticed this is a duplicate of #12860, closing in favor of that
Reproduction steps
Scala version: 2.13.12
With
-Xsource:3
and-quickfix:any
, this code is rewritten:to this:
Problem
Note that
def getFoo
in thefromFoo
instance has its return type annotated before its parameter list