This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Questions about the compiler

2 replies
Raman Gupta
Joined: 2012-01-28,
User offline. Last seen 42 years 45 weeks ago.
Using Scala 2.9.1. I have a simple java bean class with an annotation e.g.
@Foopublic class FooBean {
    ...}
I have some scala code that calls a method on FooBean.
The Foo annotation class is in a jar that is not accessible to the scala compiler, but FooBean is available in the compiler's classpath. When the scala compiler tries to compile my scala code, it gives me a "Missing dependency" error:
scala> new FooBeanerror: error while loading FooBean, Missing dependency 'class package.to.Foo', required by /home/raman/test/jars/foobean.jar(FooBean.class)<console>:8: error: FooBean does not have a constructor              new FooBean
This seems very similar to https://issues.scala-lang.org/browse/SI-1135, which is marked as Fixed.
Has SI-1135 been broken in Scala 2.9.1?
Also, on a side note, I noticed that the subsequent times the compilation is executed, the "Missing dependency" error is no longer shown (which can be confusing):
scala> new FooBean<console>:8: error: FooBean does not have a constructor
              new FooBean
Regards,
Raman
Jason Zaugg
Joined: 2009-05-18,
User offline. Last seen 38 weeks 5 days ago.
Re: Questions about the compiler
On Sat, Jan 28, 2012 at 5:46 AM, Raman Gupta <rocketraman@gmail.com> wrote:
Using Scala 2.9.1. I have a simple java bean class with an annotation e.g.
@Foopublic class FooBean {
    ...}
I have some scala code that calls a method on FooBean.
The Foo annotation class is in a jar that is not accessible to the scala compiler, but FooBean is available in the compiler's classpath. When the scala compiler tries to compile my scala code, it gives me a "Missing dependency" error:

I believe this was fixed once and for all as SI-5343 [1] in commit 1684baef [2]. This is not available yet in a released version of Scala, but is available in 2.10.0-M1.
-jason
[1] https://issues.scala-lang.org/browse/SI-5343[2] https://github.com/scala/scala/commit/1684baef
Raman Gupta
Joined: 2012-01-28,
User offline. Last seen 42 years 45 weeks ago.
Re: Questions about the compiler
On Saturday, January 28, 2012 4:01:15 AM UTC-5, Jason Zaugg wrote:
On Sat, Jan 28, 2012 at 5:46 AM, Raman Gupta <rocke...@gmail.com> wrote:
The Foo annotation class is in a jar that is not accessible to the scala compiler, but FooBean is available in the compiler's classpath. When the scala compiler tries to compile my scala code, it gives me a "Missing dependency" error:

I believe this was fixed once and for all as SI-5343 [1] in commit 1684baef [2]. This is not available yet in a released version of Scala, but is available in 2.10.0-M1.
-jason
[1] https://issues.scala-lang.org/browse/SI-5343[2] https://github.com/scala/scala/commit/1684baef

My google-fu failed me this time. Thank you!
Regards,
Raman

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland