docs/_docs/reference/error-codes/E066.md
This error is emitted when a method marked with @native annotation has an implementation body.
The @native annotation indicates that the method's implementation is provided by the runtime or a native library (like JNI). Native methods must be declared without a body because their implementation exists outside of Scala code.
class Example:
@native def nativeMethod(): Int = 42
-- [E066] Syntax Error: example.scala:2:14 -------------------------------------
2 | @native def nativeMethod(): Int = 42
| ^
| @native members may not have an implementation
// Remove the implementation from native methods
class Example:
@native def nativeMethod(): Int
// Or remove @native if you want to provide an implementation
class Example:
def normalMethod(): Int = 42