Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.4
-
None
-
Windows 7
Eclipse Juno
Groovy Eclipse 2.7.1
Description
This worked with Groovy 2.0.0, with 2.0.4 it doesn't
(where is your test coverage?)
package groovy.bugs.typechecker import static org.hamcrest.CoreMatchers.* import static org.junit.Assert.* import groovy.transform.TypeChecked @TypeChecked class AssertNotNullTypecheckerBugTest { @org.junit.Test public void sometest() throws Exception { // act String result = '12345'.substring(2) // assert assertThat(result, notNullValue()) assertEquals('345', result) } }
I get the following error in Eclipse
Description Resource Path Location Type Groovy:[Static type checking] - Cannot call org.junit.Assert#assertThat(java.lang.Object <T extends java.lang.Object>, org.hamcrest.Matcher <T extends java.lang.Object>) with arguments [java.lang.String, org.hamcrest.Matcher <T extends java.lang.Object>] AssertNotNullTypecheckerBugTest.groovy /GroovyBugs/src/groovy/bugs/typechecker line 15 Java Problem
-> The eclipse project containing this sample is attached.