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/Groovy21InferencingTests.java
+25-15
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-2023 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.
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
+19
Original file line number
Diff line number
Diff line change
@@ -7122,4 +7122,23 @@ public void testTypeChecked11083() {
7122
7122
"Groovy:[Static type checking] - Cannot assign value of type java.util.Date to variable of type java.lang.Number\n" +
7123
7123
"----------\n");
7124
7124
}
7125
+
7126
+
@Test
7127
+
publicvoidtestTypeChecked11168() {
7128
+
//@formatter:off
7129
+
String[] sources = {
7130
+
"Main.groovy",
7131
+
"def <T> T m(@DelegatesTo(type='T',strategy=Closure.DELEGATE_FIRST) Closure c) {\n" +
// NOTE: Exact match of Closure to SAM Type creates tie for m(Closure) and m(Comparator)
1262
1262
result = !GroovyUtils.isAssignable(source, target) && !(VariableScope.CLOSURE_CLASS_NODE.equals(source) && ClassHelper.isSAMType(target)) ? Boolean.FALSE : null; // not an exact match
Copy file name to clipboardexpand all lines: base/org.eclipse.jdt.groovy.core/src/org/eclipse/jdt/groovy/search/TypeInferencingVisitorWithRequestor.java
0 commit comments