autowire icon indicating copy to clipboard operation
autowire copied to clipboard

The addition of dependency to autowire causing problem with compilation

Open czajah opened this issue 10 years ago • 5 comments

adding dependency "com.lihaoyi" %% "autowire" % "0.2.3" make compilation fails with error:

object creation impossible, since method PerRunReporting in trait Reporting of type => this.PerRunReporting is not defined [error] val g = new scala.tools.nsc.Global(settings,reporter){ [error] ^

scala version: 2.11.1

The last version of autowire which works for me is 0.1.2

do you have any temporary workaround I can use?

czajah avatar Oct 11 '14 10:10 czajah

Have you tried cleaning and re-compiling? I don't see how adding a dependency should do anything

lihaoyi avatar Oct 16 '14 03:10 lihaoyi

Hm, I've never used the "clean" command. What I've observed is: when I change version to any higher than 0.1.2 I get the error and when I change it back to 0.1.2 or lower everything compiles without problems. In few days I will try to prepare minimal project setup on which I will be able to reproduce this behaviour and send it to you - I can't do this now

czajah avatar Oct 16 '14 15:10 czajah

Closing this for now, feel free to re-open when you have a minimal example ^_^

lihaoyi avatar Nov 01 '14 07:11 lihaoyi

I had a lot of work and I forgot about that :) Here https://www.dropbox.com/s/8erqzshe3jxjnan/autowire-issue-example.tar.gz you have project witch fails to compile for me with message:

[error] /home/run/tmp/autowire-issue-example/scalajvm/app/controllers/Application.scala:40: object creation impossible, since method PerRunReporting in trait Reporting of type => this.PerRunReporting is not defined
[error]     val g = new scala.tools.nsc.Global(settings,reporter){
[error]                 ^
[error] one error found
[error] (issue-jvm/compile:compile) Compilation failed

when you change autowire dependency to 0.1.2 version it compiles without problems

czajah avatar Nov 01 '14 11:11 czajah

whoa that looks unusual. You are instantiating the compiler in your code? I'd guess that the version of scala-reflect Autowire pulls in (2.11.2 I think?) Is stomping over the version your code is expecting. Would it be correct to say you're pulling in a version of scala-reflect and your scalaVersion isn't 2.11.2?

lihaoyi avatar Nov 02 '14 23:11 lihaoyi