Hamcrest 1.2 compile problem
I ran into problems when attempting to use Eclipse 3.6.2 (32-bit) on Windows 7, and Hamcrest 1.2:
@Test
def testCloseTo1 = {
assertThat(1.23, is(equalTo(1.23))) // this works fine
assertThat(1.23, is(closeTo(1.231, 0.01))) // this fails to compile ("type mismatch; found : org.hamcrest.Matcher[java.lang.Double] required: org.hamcrest.Matcher[_ >: Any]")
}
I'm a newbie as far as Scala goes, so I apologize in advance if this is due to a bug in my code, but I tried the same in Java and it seemed to work. This same problem occurred when I tried it on Galileo 3.5.2 and the Scala IDE for Scala 2.8.1.
@Test
def testCloseTo1 = {
assertThat(1.23, is(equalTo(1.23))) // this works fine
assertThat(1.23, is(closeTo(1.231, 0.01))) // this fails to compile ("type mismatch; found : org.hamcrest.Matcher[java.lang.Double] required: org.hamcrest.Matcher[_ >: Any]")
}
I'm a newbie as far as Scala goes, so I apologize in advance if this is due to a bug in my code, but I tried the same in Java and it seemed to work. This same problem occurred when I tried it on Galileo 3.5.2 and the Scala IDE for Scala 2.8.1.
Leave a comment
on 2011-03-29 08:25 *
By Iulian Dragos
Updating tickets (#1000238, #1000326, #1000331, #1000264, #1000298, #1000314, #1000315, #1000325, #1000329, #1000333, #1000277, #1000209, #1000210, #1000288, #1000299, #1000300, #1000301, #1000305, #1000309, #1000310, #1000327, #1000270, #1000292, #1000293, #1000294, #1000295, #1000297, #1000303, #1000304, #1000312, #1000320)
This looks like a legitimate compilation error. Please reopen if this program compiles fine on the command line (or using sbt, or another build tool), and please include a complete program that can be used to reproduce your failure.