-
Notifications
You must be signed in to change notification settings - Fork 499
Open
Labels
bugSomething isn't workingSomething isn't workinggroovyparsertest providedAlready replicated with a unit test, using JUnit pioneer's ExpectedToFailAlready replicated with a unit test, using JUnit pioneer's ExpectedToFail
Description
What version of OpenRewrite are you using?
Current main = 52f563b
What is the smallest, simplest way to reproduce the problem?
@Test
void dotAmpersand() {
rewriteRun(
groovy(
"""
class Validator {
void validate(Closure logger) {
logger("Something went wrong")
}
}
def v = new Validator()
// Use Groovy method-pointer syntax on a Java object:
v.validate(System.err.&println)
"""
)
);
}case added to one of the Groovy unit tests fails with:
org.opentest4j.AssertionFailedError: [When parsing and printing the source code back to text without modifications, the printed source didn't match the original source code. This means there is a bug in the parser implementation itself. Please open an issue to report this, providing a sample of the code that generated this error. "file.groovy":
// Use Groovy method-pointer syntax on a Java object:
-v.validate(System.err.&println)
+v.validate(System.err::.&println)OSS repro
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggroovyparsertest providedAlready replicated with a unit test, using JUnit pioneer's ExpectedToFailAlready replicated with a unit test, using JUnit pioneer's ExpectedToFail
Type
Projects
Status
Backlog