Welcome to Scala version 2.10.0-M3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_31). Type in expressions to have them evaluated.
Type :help for more information.scala> def foo[R] = null.asInstanceOf[R] foo: [R]=> R
scala> foo[String] res0: String = null
scala> foo[Int] res1: Int = 0
scala> import org.scalatest.Suite import org.scalatest.Suite
scala> class BugSuite extends Suite { def test1 = expect(0) { foo[Int] }; def test2 = { val x = foo[Int]; expect(0) { x } } } defined class BugSuite
scala> (new BugSuite).execute()
BugSuite:
- test1 *** FAILED ***
Expected 0, but got null (<console>:9)- test2
Welcome to Scala version 2.10.0-M3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_31).Type in expressions to have them evaluated.Type :help for more information.scala> def foo[R] = null.asInstanceOf[R]foo: [R]=> Rscala> foo[String]res0: String = nullscala> foo[Int]res1: Int = 0scala> import org.scalatest.Suiteimport org.scalatest.Suitescala> class BugSuite extends Suite { def test1 = expect(0) { foo[Int] }; def test2 = { val x = foo[Int]; expect(0) { x } } }defined class BugSuitescala> (new BugSuite).execute()BugSuite:- test1 *** FAILED ***Expected 0, but got null (<console>:9)- test2
Hmm - let's try that again, with slightly less screwed up formatting this time, I hopev
--
You received this message because you are subscribed to the Google
Groups "scalatest-users" group.
To post to this group, send email to scalate...@googlegroups.com
To unsubscribe from this group, send email to
scalatest-use...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/scalatest-users?hl=en
ScalaTest itself, and documentation, is available here:
http://www.artima.com/scalatest