The Artima Developer Community
Sponsored Link

ScalaTest/ScalaUtils Forum
unable to compile the StackSpec example

5 replies on 1 page. Most recent reply: May 29, 2009 2:17 PM by Bill Venners

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 5 replies on 1 page
Emil Kirschner

Posts: 9
Nickname: entzik
Registered: Aug, 2007

unable to compile the StackSpec example Posted: May 26, 2009 5:03 AM
Reply to this message Reply
Advertisement
Hi, I'm trying to compile the StackSpec example with scala 2.7.4 and scalatest 0.9.5 and I get the following error:

================
Information:Compilation completed with 1 error and 0 warnings
Information:1 error
Information:0 warnings
/home/entzik/work/personal/scalaplay/collections/tests/com/thekirschne rs/scala/collections/StackSpec.scala
Error:Error:line (8)error: class StackSpec needs to be abstract, since type _$8 in trait Matchers with bounds >: scala.this.Nothing <: scala.this.Any is not defined
class StackSpec extends Spec with ShouldMatchers {
================

I'm compiling from idea using the scala suport plugin.

Any hint?

thanks,
e.


Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: unable to compile the StackSpec example Posted: May 27, 2009 6:05 AM
Reply to this message Reply
Can you post the entire StackSpec class?

Thanks.

Emil Kirschner

Posts: 9
Nickname: entzik
Registered: Aug, 2007

Re: unable to compile the StackSpec example Posted: May 28, 2009 1:50 AM
Reply to this message Reply
sure, here it is. Its a copy/paste from the example here: http://www.artima.com/scalatest/, I only added only the package and the some imports.

thanks for looking into this.


package com.thekirschners.scala.collections

import collection.mutable.Stack
import org.scalatest.Spec
import org.scalatest.matchers.ShouldMatchers

class StackSpec extends Spec with ShouldMatchers {

describe("A Stack") {

it("should pop values in last-in-first-out order") {
val stack = new Stack[Int]
stack.push(1)
stack.push(2)
stack.pop() should equal (2)
stack.pop() should equal (1)
}

it("should be empty when created") {
val stack = new Stack[Int]
stack should be ('empty)
}
}
}

Emil Kirschner

Posts: 9
Nickname: entzik
Registered: Aug, 2007

Re: unable to compile the StackSpec example Posted: May 28, 2009 6:17 AM
Reply to this message Reply
I guess it's a bug in the IDEA plugin since it compiles properly from command line. It's weird though, the library I want to test compiles just fine, and the small test application compiles and work as expected as well. Only scalatest test classes with matchers fail to compile....

Emil Kirschner

Posts: 9
Nickname: entzik
Registered: Aug, 2007

Re: unable to compile the StackSpec example Posted: May 28, 2009 6:37 AM
Reply to this message Reply
Hi, I fixed it. this was due to a classpath mess: some older version of scala was laying around + a forgotten symlink.

now with the right setup everything works fine.

thanks for looking into this and sorry for wasting your time.

e.

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: unable to compile the StackSpec example Posted: May 29, 2009 2:17 PM
Reply to this message Reply
Hi Emil,

> Hi, I fixed it. this was due to a classpath mess: some
> older version of scala was laying around + a forgotten
> symlink.
>
> now with the right setup everything works fine.
>
> thanks for looking into this and sorry for wasting your
> time.
>
> e.
No problem. No time wasted. This kind of thing seems to happen now and then when working with Scala unfortunately. Binary compatibility between Scala releases is not yet a feature to near the extent it is in Java.

Flat View: This topic has 5 replies on 1 page
Topic: Empty test suite error Previous Topic   Next Topic Topic: VerifyError - main method can only throw Throwable.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use