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

error: illegal inheritance;

2 replies
Jesse Eichar
Joined: 2008-12-20,
User offline. Last seen 42 years 45 weeks ago.

Hi,

I grabbed a nightly scala 2.8 build and tried to build some of my
tests with it. I used Specs 1.5 for the testing framework but when I
did the build the following error occurred.

[WARNING] error: error while loading Specification, Scala signature
Specification has wrong version
[WARNING] expected: 5.0
[WARNING] found: 4.1 in
/home/jeichar/.m2/repository/org/scala-tools/testing/specs/1.5.0/specs-1.5.0.jar(org/specs/Specification.class)
[WARNING] /home/jeichar/Projects/mvn-scala-skin/src/test/scala/pscript/io/FilesSpec.scala:7:
error: illegal inheritance;
[WARNING] self-type pscript.io.FilesSpec.type does not conform to
org.specs.Specification's selftype org.specs.Specification
[WARNING] object FilesSpec extends Specification{

From the research I have done it has some thing to do with self types
but I didnt really understand the solutions. But I am only getting
this when I use scala 2.8. The version I am using was downloaded
about June 3rd or so.

Any ideas as to why this is happening? Do I have to compile specs
with 2.8.0 to make it work?

Jesse

Erik Engbrecht
Joined: 2008-12-19,
User offline. Last seen 3 years 18 weeks ago.
Re: error: illegal inheritance;
All Scala libraries you use should be compiled using the same version of the compiler and the same version of the standard library.  You can't just pick up a jar for one version of Scala and expect it to work on another.

So yes, you need to compile specs using 2.8.

On Mon, Jun 8, 2009 at 12:45 PM, Jesse Eichar <jeichar [dot] w [at] gmail [dot] com> wrote:
Hi,

I grabbed a nightly scala 2.8 build and tried to build some of my
tests with it.  I used Specs 1.5 for the testing framework but when I
did the build the following error occurred.

[WARNING] error: error while loading Specification, Scala signature
Specification has wrong version
[WARNING]  expected: 5.0
[WARNING]  found: 4.1 in
/home/jeichar/.m2/repository/org/scala-tools/testing/specs/1.5.0/specs-1.5.0.jar(org/specs/Specification.class)
[WARNING] /home/jeichar/Projects/mvn-scala-skin/src/test/scala/pscript/io/FilesSpec.scala:7:
error: illegal inheritance;
[WARNING]  self-type pscript.io.FilesSpec.type does not conform to
org.specs.Specification's selftype org.specs.Specification
[WARNING] object FilesSpec extends Specification{



From the research I have done it has some thing to do with self types
but I didnt really understand the solutions.  But I am only getting
this when I use scala 2.8.  The version I am using was downloaded
about June 3rd or so.

Any ideas as to why this is happening?  Do I have to compile specs
with 2.8.0 to make it work?

Jesse



--
http://erikengbrecht.blogspot.com/
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: error: illegal inheritance;

On Mon, Jun 08, 2009 at 06:45:15PM +0200, Jesse Eichar wrote:
> Any ideas as to why this is happening? Do I have to compile specs
> with 2.8.0 to make it work?

Yes. The pickler format changed, and since we're nowhere near binary
compatibility anyway, it was determined that temporarily supporting the
old format added useless complexity. Better to obviously break than
subtly break with AbstractMethodErrors and etc.

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