Closed
Description
Minimized code
object FooMacros {
def foo: String = macro Foo.fooImpl[T]
}
Output
-- [E006] Not Found Error: FooMacros.scala:2:26
2 | def foo: String = macro Foo.fooImpl[T]
| ^^^
| Not found: Foo
longer explanation available when compiling with `-explain`
-- [E006] Not Found Error: FooMacros.scala:2:38
2 | def foo: String = macro Foo.fooImpl[T]
| ^
| Not found: type T
Expectation
This is what you get in Scala 2 at typer
FooMacros.scala:2: error: macro definition needs to be enabled
by making the implicit value scala.language.experimental.macros visible.
This can be achieved by adding the import clause 'import scala.language.experimental.macros'
or by setting the compiler option -language:experimental.macros.
See the Scaladoc for value scala.language.experimental.macros for a discussion
why the feature needs to be explicitly enabled.
def foo: String = macro Foo.fooImpl[T]
^
1 error