Re: Re: Compiler says: "Object is not a declared class or interface"
"Andreas Schroeder" <[email protected]>
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <61003.213.6.234.55.1075717058.squirrel@webmail.informatik.uni-muenchen.de> |
>
> ... hm, i will try to find a subset of the code that exposes this behavior
> in the evening.
>
i wasn't able to wait (even though i am writing a test today), so i found
the following. Here is some code that exhibits the behavior.
[code]
package test;
void main(String[] args) { }
public class A
{
private B b = new B();
}
public class B { }
[/code]
Note that the following code compiles the second time without any problems
(just swapped A and B!!!):
[code]
package test;
void main(String[] args) { }
public class B { }
public class A
{
private B b = new B();
}
[/code]
i compile it with ant. The ant target worked fine with the compiler 0.9.5,
and is the
following (i omitted some ant properties and tasks):
...
<path id="nicec.class.path">
<pathelement path="${nice.jar}"/>
</path>
<taskdef name="nicec" classname="nice.tools.ant.Nicec">
<classpath refid="nicec.class.path"/>
</taskdef>
<path id="compile.class.path">
<pathelement path="${logging.lib}"/>
<pathelement path="${niceswing.lib}"/>
</path>
...
<target name="compile" depends="prepare">
<nicec
package="${main.pkg}"
sourcepath="${src.dir}"
destination="${class.dir}"
jar="${class.dir}\${dist.jar}">
<classpath refid="compile.class.path"/>
</nicec>
</target>
As allready mentioned, the first compilation works fine. The second
compilation with allready existing package.nicei and *.class files is
failing with the following error:
compile:
[nicec] nice.lang: parsing
[nicec] test: parsing
[nicec]
[nicec] H:\nFasTriX\class\test\package.nicei: line 1, column 7:
[nicec] Class test.B has no constructor
BUILD FAILED
Hope this helps you finding the bug,
Andreas
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn