Closed
Description
I'm getting an unexpected error message when trying to export an inline definition:
[error] 12 | export Macros.show
[error] | ^^^^^^
[error] | method show is declared as erased, but is in fact used
minimized code
package test
trait Show[-A]
def show(a: A): String
object Macros
inline def (sc: StringContext) show(args: =>Any*): String = ???
object Show
def[A] (a: A) show(given S: Show[A]): String = S.show(a)
export Macros.show
In this case, the inline
doesn't make much sense, in the larger version it's a macro which has been moved to a separate file so it can be used within Show.scala
.
expectation
I'd like to be able to present the full API in a central location, with minimal import tax. It's reasonable to expect the users to import Show.show
or Show.given
, but not really reasonable to expect them to import Show.show
and macros.Show.show
, if it's at all avoidable.
If this is something that is not supported, I'd expect a more relevant error message, as erased
isn't part of the (visible) definitions.