-
Notifications
You must be signed in to change notification settings - Fork 21
akka-http ScalatestRouteTest example doesn't compile after update to 2.12.5 #10800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
are you on Java 9 or 10, and is there a "macro implementation not found" message somewhere in the full trace of your attempt? if so, it's scala/scala-dev#480 and you need to downgrade to Java 8 or wait for 2.12.6 this information is now in the 2.12.5 blog post and release notes (it wasn't, initially) |
I am running the compiler ina Java 9 environment, but the compiler reports only the errors as a compile error on the should/shouldEqual ScalaTest keywords and terminates normally. Error message is "macro implementation not found" is not shown. |
can you link to a complete log of the entire compilation session? |
Results in:
Using scalatest 3.0.+ |
I'm not able to reproduce the problem:
here are the files I'm using: https://gist.github.com/SethTisue/8a0b12bff642393049caae9e6f98883c |
Result of your code in my Java 9.0.4 system:
Any idea? |
Modified scalaVersion:
|
perhaps there is some Windows specific issue here. (I’m on MacOS.) |
I can reproduce this on OS X, and it is indeed yet another manifestation of scala/scala-dev#480. (The telltale phrase from that ticket doesn't show up because the failure to load the macro is suppressed by the implicit view search, so you get the generic " With sbt:wat> compile
[info] Compiling 1 Scala source to /Users/hhoughton/tmp/wat/target/scala-2.12/classes ...
...
macroExpand: expander = scala.tools.nsc.typechecker.Macros$DefMacroExpander@2b21a2d6, expandee = Select[1](Select[2](This[3](TypeName("source")), org.scalactic.source.Position#22484), TermName("here")#46214)
[1] TypeRef(ThisType(org.scalactic.source#16474), org.scalactic.source.Position#22483, List())
[2] SingleType(ThisType(org.scalactic.source#16474), org.scalactic.source.Position#22484)
[3] ThisType(org.scalactic.source#16474), desugared = ()
looking for macro implementation: macro method here
resolving macro implementation as org.scalactic.source.PositionMacro$.genPosition (isBundle = false)
macro runtime failed to load: java.lang.NullPointerException
macro expansion has failed: macro implementation not found: here
(the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them)
undetParam added: type T
undetParam inferred: type T as String
[error] /Users/hhoughton/tmp/wat/src/main/scala/S.scala:21:17: value should is not a member of String
[error] "The service" should {
[error] ^ So (as Seth said) you should either use java 8 or wait for 2.12.6 (which is currently targeted for 9 April, last I heard). |
thanks Harrison. (I wonder what I did wrong when trying to reproduce it, but oh well.) |
Happened to me just now, but it's working if instead of @SethTisue, maybe you're IDE aded that import. |
After updating in sbt the
scalaVersion
from 2.12.4 to 2.12.5 the compiler reports an "value should is not a member of String" or "value shouldEqual is not a member of String" error.This source code is here given.
The symptom manifests itself typically at the version bump.
The text was updated successfully, but these errors were encountered: