incremental compile required to get java/scala dependencies right
Migrated from http://lampsvn.epfl.ch/trac/scala/ticket/2889
Reporter shaberman
With two classes:
JavaB.java--public class JavaB { public int i = 1; }
ScalaC.java--class ScalaC { val b = new JavaB() }
Causes the line "val b" to get a "JavaB does not have a constructor" error. Note that technically there are no real Problems, this is just a line error.
Making the error goes away requires manually changing JavaB (e.g. set i = 2), then manually changing ScalaC (e.g. rename val b to val c). Basically, incrementally compiling each file, then the "no constructor" error goes away.
Hitting clean build makes it come back.
I'm using r20428.
Reporter shaberman
With two classes:
JavaB.java--public class JavaB { public int i = 1; }
ScalaC.java--class ScalaC { val b = new JavaB() }
Causes the line "val b" to get a "JavaB does not have a constructor" error. Note that technically there are no real Problems, this is just a line error.
Making the error goes away requires manually changing JavaB (e.g. set i = 2), then manually changing ScalaC (e.g. rename val b to val c). Basically, incrementally compiling each file, then the "no constructor" error goes away.
Hitting clean build makes it come back.
I'm using r20428.
Leave a comment
on 2010-01-11 04:35 *
By tracImporter
Trac author: shaberman
This might be a dup of the 1st comment of #1964--they report incremental working fine but clean not as well. But technically the bug was about incremental not working, plus I got an easy reproducible case, so I thought I'd file this as a separate bug. Apologies if I should not have.
This might be a dup of the 1st comment of #1964--they report incremental working fine but clean not as well. But technically the bug was about incremental not working, plus I got an easy reproducible case, so I thought I'd file this as a separate bug. Apologies if I should not have.
on 2010-01-11 06:33 *
By tracImporter
on 2010-01-11 07:24 *
By tracImporter
Trac author: spiros
@shaberman:
This is a duplicate of #2767 and the the example you provide translated to Scala is the simplest code that triggers this long standing bug.
A HUGE thanks for submitting this bug report!
@milessabin:
This is a duplicate of #2767 and provides the much awaited simple code example that reproduces the Clean&Build bug.
To reproduce the bug use:
@shaberman:
This is a duplicate of #2767 and the the example you provide translated to Scala is the simplest code that triggers this long standing bug.
A HUGE thanks for submitting this bug report!
@milessabin:
This is a duplicate of #2767 and provides the much awaited simple code example that reproduces the Clean&Build bug.
To reproduce the bug use:
// file: /src/A.scala
class A {
var a = 10
}
and// file: /src/B.scala
class B {
val a = new A
}
After saving B, do a Clean&Build and you will get a bogus error message in the editor saying: "A does not have a constructor".
on 2010-01-11 17:26 *
By
I'm afraid I can't reproduce either of these :-(
on 2010-01-11 17:54 *
By tracImporter
Trac author: shaberman
...okay, somehow I made a new project and it worked (like you said, I couldn't reproduce it), then I was fooling around and it started happening again. Now I can't get it to go away. I can't tell what I did though. Is there any where to turn up logging/debug levels within the plugin?
...okay, somehow I made a new project and it worked (like you said, I couldn't reproduce it), then I was fooling around and it started happening again. Now I can't get it to go away. I can't tell what I did though. Is there any where to turn up logging/debug levels within the plugin?
on 2010-01-11 17:57 *
By tracImporter
Trac author: spiros
Are classes A and B in the default package? I just found that this happens when A and B are in the default package. Can you pls try it out?
Are classes A and B in the default package? I just found that this happens when A and B are in the default package. Can you pls try it out?
on 2010-01-11 18:16 *
By tracImporter
Trac author: spiros
This might be a different bug than #2767. There are two ways to trigger this.
The 1st way # Create a Scala project
After step 4 we get a bogus error in the editor saying: "A does not have a constructor".
The 2nd way # Create a Scala project
This might be a different bug than #2767. There are two ways to trigger this.
The 1st way # Create a Scala project
- Create a Scala class A in the default package
- Create the following class in the default package
class B {
val a = new A
}
# Do a Clean&BuildAfter step 4 we get a bogus error in the editor saying: "A does not have a constructor".
The 2nd way # Create a Scala project
- Create a Scala class A in the default package
- Do a Clean&Build
- Create the following class in the default package
class B {
val a = new A
}
After step 4 we get a bogus error in the editor saying: "A does not have a constructor".
on 2010-01-11 18:46 *
By
OK, I can reproduce this with the classes in the default package.
on 2010-01-13 11:51 *
By
Interestingly I've also been able to persuade the build compiler to produce this on a couple of occasions. I suspect that compilation with some combination of existing/absent class files is at the root of the problem.
on 2010-01-13 20:15 *
By tracImporter
Trac author: shaberman
What's odd to me is that whatever bogus line errors there are, the Problems view is always correct (e.g. no bogus errors). It's like they're using different classpaths, sources, something (yeah, I don't really know what I'm talking about).
What's odd to me is that whatever bogus line errors there are, the Problems view is always correct (e.g. no bogus errors). It's like they're using different classpaths, sources, something (yeah, I don't really know what I'm talking about).
on 2010-01-13 22:08 *
By
Actually, with enough persistence fiddling around, editing, saving and cleaning, I've been able to get the error appearing in the Problems view as well ... so I think it's a generic issue rather than being restricted to the presentation compiler.
on 2010-01-13 22:25 *
By tracImporter
Trac author: shaberman
Oh, cool. I've seen lots of these bogus line errors, and never seen one in problems view...as I recall. Maybe a few times that a clean then fixed? I dunno, I clean a lot, which the problem view usually likes. I'll pay more attention though.
Oh, cool. I've seen lots of these bogus line errors, and never seen one in problems view...as I recall. Maybe a few times that a clean then fixed? I dunno, I clean a lot, which the problem view usually likes. I'll pay more attention though.
on 2010-01-15 01:06 *
By tracImporter
Trac author: shaberman
Yeah, I'm seeing it outside the default package, but cool that this case was fixed. I'll switch to #2767 for any future possible reproductions of this. Thanks!
Yeah, I'm seeing it outside the default package, but cool that this case was fixed. I'll switch to #2767 for any future possible reproductions of this. Thanks!
on 2010-01-15 10:28 *
By tracImporter
Trac author: shaberman
Miles, this is really great. I'm nervous to say anything and jinx it, but the newest nightly is much, much better. I'm trying progressively bigger and bigger edits to try and get incorrect line errors and nothing yet. Thanks!
Miles, this is really great. I'm nervous to say anything and jinx it, but the newest nightly is much, much better. I'm trying progressively bigger and bigger edits to try and get incorrect line errors and nothing yet. Thanks!
on 2010-01-15 12:01 *
By tracImporter
Trac author: spiros
Although things appear to have improved, the bug unfortunately is still valid. I'll try to create a small code example to reproduce this bug later today.
Although things appear to have improved, the bug unfortunately is still valid. I'll try to create a small code example to reproduce this bug later today.
on 2010-01-15 12:02 *
By tracImporter
Trac author: spiros
Ignore my last comment it was for bug #2767. Sorry :-(
Ignore my last comment it was for bug #2767. Sorry :-(
on 2010-01-15 12:02 *
By tracImporter
Closed As: fixed