Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7201d70
Render nested generic type arguments in the AST-to-source transpiler
leonard84 Jul 9, 2026
52bb1ae
Add release notes entry for nested generic transpiler fix
leonard84 Jul 9, 2026
ddbbfbd
Render the elvis operator in its short form in the AST-to-source tran…
leonard84 Jul 9, 2026
dd021f1
Render attribute access with the at sign in the AST-to-source transpiler
leonard84 Jul 9, 2026
858817a
Render implicit-it closures without an arrow in the AST-to-source tra…
leonard84 Jul 9, 2026
05bb3e3
Render safe index access faithfully in the AST-to-source transpiler
leonard84 Jul 9, 2026
eb6fcfd
Keep numeric literal type suffixes in the AST-to-source transpiler
leonard84 Jul 9, 2026
625aa71
Render left-open ranges in the AST-to-source transpiler
leonard84 Jul 9, 2026
96d88d4
Render explicit type arguments of method calls in the AST-to-source t…
leonard84 Jul 9, 2026
6a03dcc
Add release notes entry for the additional transpiler rendering fixes
leonard84 Jul 9, 2026
e957171
Skip the default label for switches without one in the AST-to-source …
leonard84 Jul 9, 2026
d2d1ddc
Skip the finally block for try statements without one in the AST-to-s…
leonard84 Jul 9, 2026
9415b3b
Render the index variable of for-in loops in the AST-to-source transp…
leonard84 Jul 9, 2026
7f93a6c
Close the classloader created by the AST-to-source transpiler
leonard84 Jul 9, 2026
0892f8c
Mention the adopted upstream transpiler fixes in the release notes
leonard84 Jul 9, 2026
d4bd9e8
Adopt upstream's cosmetic rendering improvements in the AST-to-source…
leonard84 Jul 9, 2026
846e09c
Accept any classloader in the AST-to-source transpiler
leonard84 Jul 9, 2026
a56e2bd
Extract shared helpers in the AST-to-source transpiler
leonard84 Jul 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,11 @@ class AstNodeToScriptVisitor extends CompilationUnit.PrimaryClassNodeOperation i
}
first = false
print it.name
// a concrete type argument may carry its own nested type arguments (e.g. Tuple2<Integer, Integer>);
// recurse so they are not dropped. Placeholders (T) and wildcards (?) never carry them.
if (!it.placeholder && !it.wildcard) {
visitGenerics it.type?.genericsTypes
}
if (it.upperBounds) {
print ' extends '
boolean innerFirst = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,20 @@ class Foo {
snapshotter.assertThat(result.source).matchesSnapshot()
}

def "nested generic type arguments are rendered faithfully"() {
when:
def result = compiler.transpile('''
class Foo {
Map<String, List<Integer>> nested() { null }
List<? extends Number> upperBounded() { null }
def <T extends CharSequence> List<T> methodTypeParameter() { null }
}
''', EnumSet.of(Show.METHODS))

then:
snapshotter.assertThat(result.source).matchesSnapshot()
}

def "enums"() {
given:
// groovy 4 renders differently
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public java.util.Map<String, List<Integer>> nested() {
null
}

public java.util.List<? extends java.lang.Number> upperBounded() {
null
}

public <T extends java.lang.CharSequence> java.util.List<T> methodTypeParameter() {
null
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Loading