Skip to content

Commit b154bbc

Browse files
committed
GROOVY-11998: Better support of intersection types (copilot review)
1 parent d94edee commit b154bbc

6 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/main/java/org/codehaus/groovy/ast/IntersectionTypeClassNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
* interfaces array contains only interface components and the superclass is
4949
* the (at most one) class component.
5050
*
51-
* @since 5.0.0
51+
* @since 6.0.0
5252
*/
5353
public final class IntersectionTypeClassNode extends ClassNode {
5454

src/main/java/org/codehaus/groovy/classgen/asm/sc/AbstractFunctionalInterfaceWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ default void writeFunctionalInterfaceIndy(final MethodVisitor methodVisitor,
9090
* {@code LambdaMetafactory.altMetafactory} via {@code FLAG_MARKERS} so the
9191
* generated lambda implements every component interface at runtime.
9292
*
93-
* @since 5.0.0
93+
* @since 6.0.0
9494
*/
9595
default void writeFunctionalInterfaceIndy(final MethodVisitor methodVisitor,
9696
final String samMethodName, final String invokedTypeDescriptor,

src/main/java/org/codehaus/groovy/runtime/IntersectionCastSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* reference (those cases are handled at compile time via
3636
* {@code LambdaMetafactory.altMetafactory} markers).
3737
*
38-
* @since 5.0.0
38+
* @since 6.0.0
3939
*/
4040
public final class IntersectionCastSupport {
4141

src/spec/doc/core-semantics.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ include::../test/CoercionTest.groovy[tags=intersection_as_coercion_marker,indent
793793
----
794794
795795
For closure literals and maps, `as` builds a
796-
{@link groovy.util.ProxyGenerator} aggregate that implements every interface
796+
`groovy.util.ProxyGenerator` aggregate that implements every interface
797797
component:
798798
799799
[source,groovy]

src/test/groovy/groovy/transform/stc/IntersectionCastSTCTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ import org.junit.jupiter.api.Test
3939
/**
4040
* Tests for static type checking of intersection-cast targets (GROOVY-11998 PR2).
4141
*
42-
* These tests stop compilation at {@link Phases#SEMANTIC_ANALYSIS} so they
43-
* exercise resolution and STC without relying on bytecode generation, which
44-
* is delivered in subsequent phases.
42+
* These tests stop compilation at {@link Phases#INSTRUCTION_SELECTION} so they
43+
* exercise resolution and STC without producing class files, which keeps the
44+
* tests focused on resolution/STC behavior delivered in this PR.
4545
*/
4646
final class IntersectionCastSTCTest {
4747

src/test/groovy/org/apache/groovy/parser/antlr4/IntersectionCastParserTest.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import org.codehaus.groovy.ast.ClassNode
2222
import org.codehaus.groovy.ast.IntersectionTypeClassNode
2323
import org.codehaus.groovy.ast.ModuleNode
2424
import org.codehaus.groovy.ast.expr.CastExpression
25-
import org.codehaus.groovy.ast.expr.ClassExpression
2625
import org.codehaus.groovy.ast.expr.DeclarationExpression
2726
import org.codehaus.groovy.ast.expr.Expression
2827
import org.codehaus.groovy.ast.expr.BinaryExpression
@@ -36,7 +35,6 @@ import org.junit.jupiter.api.Test
3635
import static org.junit.jupiter.api.Assertions.assertNotNull
3736
import static org.junit.jupiter.api.Assertions.assertTrue
3837
import static org.junit.jupiter.api.Assertions.assertEquals
39-
import static org.junit.jupiter.api.Assertions.assertThrows
4038

4139
/**
4240
* Tests for the parser-level handling of intersection types in cast expressions

0 commit comments

Comments
 (0)