Skip to content

Commit

Permalink
add version restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Feb 23, 2024
1 parent 9df84b3 commit 6721ac9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/test/groovy/transform/stc/MethodReferenceTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ final class MethodReferenceTest {

@Test // GROOVY-11301
void testInnerClassPrivateMethodReference() {
assertScript shell, '''
def script = '''
class C {
static class D {
private static String m() { 'D' }
Expand All @@ -1456,5 +1456,10 @@ final class MethodReferenceTest {
}
}
'''
if (Runtime.version().feature() < 15) {
shouldFail(shell, IllegalAccessError, script)
} else {
assertScript(shell, script)
}
}
}

0 comments on commit 6721ac9

Please sign in to comment.