scalamacros / paradise

(No longer actively maintained.)
http://scalamacros.org/
BSD 3-Clause "New" or "Revised" License
158 stars 53 forks source link

Macroparadise can't be used by command-line scalac #99

Open dragos opened 7 years ago

dragos commented 7 years ago

..because it depends on the scala-repl, which isn't by default in the runner script.

error: java.lang.NoClassDefFoundError: scala/tools/nsc/interpreter/ReplReporter
    at org.scalamacros.paradise.reflect.ReplIntegration.tellReplAboutExpansion(ReplIntegration.scala:21)
    at org.scalamacros.paradise.reflect.ReplIntegration.tellReplAboutExpansion$(ReplIntegration.scala:20)
    at org.scalamacros.paradise.Plugin.tellReplAboutExpansion(Plugin.scala:8)
    at org.scalamacros.paradise.typechecker.Namers$Namer$$anon$2.maybeExpand(Namers.scala:385)
    at org.scalamacros.paradise.typechecker.Namers$Namer$MaybeExpandeeCompleter.completeImpl(Namers.scala:333)
    at org.scalamacros.paradise.typechecker.Namers$Namer$MaybeExpandeeCompleter.complete(Namers.scala:323)
    at org.scalamacros.paradise.typechecker.Namers$Namer$RichType.completeOnlyExpansions(Namers.scala:351)
    at org.scalamacros.paradise.typechecker.Namers$Namer$MaybeExpandeeCompleter.load(Namers.scala:340)
    at scala.reflect.internal.Symbols$Symbol.exists(Symbols.scala:1086)
    at scala.tools.nsc.typechecker.Typers$Typer.reallyExists(Typers.scala:508)
    at scala.tools.nsc.typechecker.Typers$Typer.qualifies$1(Typers.scala:4961)
    at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typed1$55(Typers.scala:4987)
    at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typed1$55$adapted(Typers.scala:4987)
    at scala.tools.nsc.typechecker.Contexts$Context.$anonfun$lookupSymbol$3(Contexts.scala:1043)
    at scala.tools.nsc.typechecker.Contexts$Context.$anonfun$lookupSymbol$3$adapted(Contexts.scala:1043)
    at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:502)
xeno-by commented 7 years ago

Wow nice catch! Looks like we should use reflection to make repl-specific and maybe also scaladoc-specific parts of the code more robust. Is this a blocker for you?

dragos commented 7 years ago

Thanks for the quick answer. It's more of a "nice to have" than a blocker, I'm often testing/debugging outside of Sbt on real-life projects. I can work around by manually adding the Repl to the classpath.