Closed
Description
Compiler version
3.3.1
Minimized code
import scala.annotation.static
trait Foo[A]
object Foo:
@static given foo: Foo[String] = new {}
Output
4 | @static given foo: Foo[String] = new {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Lazy @static fields are not supported
1 error found
Expectation
Declaring it as an implicit val
compiles fine. So my expectation is that there is a way to do this with given
as well.
@static implicit val foo: Foo[String] = new {}
An implicit def
also works.
@static implicit def foo: Foo[String] = new {}