You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scalac does not find implicits when the use site is compiled after the definition site. Attached is a project with two files. If the project is built using sbt clean compile, it is fine. Now go into sbt ~compile and modify the Test.scala file (e.g. by adding a whitespace anywhere). It won't compile anymore:
[error] /Users/hhrutz/Desktop/implicits_bug/src/main/scala/implicitsbug/Test.scala:5: could not find implicit value for evidence parameter of typeimplicitsbug.Preferences.Type[String]
[error] p.put("value")
[error] ^
Note that this is not an sbt issue. The same happens if you successively execute:
@Sciss said (edited on Jun 2, 2013 2:05:46 AM UTC):
I've just bumped into the same one (?) again. I have attached another example. To see, run sbt test:compile, the implicits are lost in the test sources.
The bug seems to occur with the type nested in an object. If I move Values to package top-level (out of companion object Foo), the compilation succeeds.
Scalac does not find implicits when the use site is compiled after the definition site. Attached is a project with two files. If the project is built using
sbt clean compile
, it is fine. Now go intosbt ~compile
and modify theTest.scala
file (e.g. by adding a whitespace anywhere). It won't compile anymore:Note that this is not an sbt issue. The same happens if you successively execute:
What's worse, when
Bug.scala
is packaged and exported as a library, the implicit resolution fails for any project that tries to use this library.Another odd thing is, once I refer to the implicit explicitly, the resolution works in successive calls:
The text was updated successfully, but these errors were encountered: