You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: base-test/org.eclipse.jdt.groovy.core.tests.builder/src/org/eclipse/jdt/core/groovy/tests/search/ClosureInferencingTests.java
+3-3
Original file line number
Diff line number
Diff line change
@@ -1394,7 +1394,7 @@ public void testClosureParamsAnnotation1() {
Copy file name to clipboardExpand all lines: base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/TypeCheckedTests.java
+61-1
Original file line number
Diff line number
Diff line change
@@ -170,7 +170,7 @@ public void testTypeChecked7() {
170
170
"Main.groovy",
171
171
"import groovy.transform.stc.*\n" +
172
172
"class C {\n" +
173
-
" C(String s, @ClosureParams(value=SimpleType, options='java.util.List') Closure<Integer> c) {\n" +
173
+
" C(String s, @ClosureParams(value=FromString,options='java.util.List<java.lang.Integer>') Closure<Integer> c) {\n" +
174
174
" }\n" +
175
175
"}\n" +
176
176
"@groovy.transform.TypeChecked\n" +
@@ -633,6 +633,66 @@ public void testTypeChecked6455() {
633
633
runConformTest(sources);
634
634
}
635
635
636
+
@Test
637
+
publicvoidtestTypeChecked6603() {
638
+
//@formatter:off
639
+
String[] sources = {
640
+
"Main.groovy",
641
+
"import groovy.transform.stc.*\n" +
642
+
"@groovy.transform.TypeChecked\n" +
643
+
"void test(@ClosureParams(value=FromString,options='java.lang.Number') Closure<?> c) {\n" +
644
+
" c('x')\n" +
645
+
"}\n",
646
+
};
647
+
//@formatter:on
648
+
649
+
runNegativeTest(sources,
650
+
"----------\n" +
651
+
"1. ERROR in Main.groovy (at line 4)\n" +
652
+
"\tc('x')\n" +
653
+
"\t ^^^\n" +
654
+
"Groovy:[Static type checking] - Cannot call closure that accepts [java.lang.Number] with [java.lang.String]\n" +
655
+
"----------\n");
656
+
}
657
+
658
+
@Test
659
+
publicvoidtestTypeChecked6603a() {
660
+
//@formatter:off
661
+
String[] sources = {
662
+
"Main.groovy",
663
+
"import groovy.transform.stc.*\n" +
664
+
"@groovy.transform.TypeChecked\n" +
665
+
"void test(@ClosureParams(value=FromString,options='java.util.List<java.lang.Number>') Closure<?> c) {\n" +
666
+
" c(['x'])\n" +
667
+
"}\n",
668
+
};
669
+
//@formatter:on
670
+
671
+
runNegativeTest(sources,
672
+
"----------\n" +
673
+
"1. ERROR in Main.groovy (at line 4)\n" +
674
+
"\tc(['x'])\n" +
675
+
"\t ^^^^^\n" +
676
+
"Groovy:[Static type checking] - Cannot call closure that accepts [java.util.List<java.lang.Number>] with [java.util.List<java.lang.String>]\n" +
677
+
"----------\n");
678
+
}
679
+
680
+
@Test
681
+
publicvoidtestTypeChecked6603b() {
682
+
//@formatter:off
683
+
String[] sources = {
684
+
"Main.groovy",
685
+
"import groovy.transform.stc.*\n" +
686
+
"@groovy.transform.TypeChecked\n" +
687
+
"void test(@ClosureParams(value=FromString,options='java.util.Collection<java.lang.String>') Closure<?> c) {\n" +
Copy file name to clipboardExpand all lines: ide-test/org.codehaus.groovy.eclipse.codeassist.test/src/org/codehaus/groovy/eclipse/codeassist/tests/ContentAssistLocationTests.groovy
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2009-2020 the original author or authors.
2
+
* Copyright 2009-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -1452,7 +1452,7 @@ final class ContentAssistLocationTests extends CompletionTestSuite {
0 commit comments