Closed stephan-herrmann closed 2 months ago
Hi @stephan-herrmann I realize it is quite late from when you opened the issue but do you happen to have a test scenario? I tried a simple class which has the inner static record and moving to a new file works fine for me. I can easily add a null check on the fragment variable but that is not the right solution as it is supposed to be changing the visibility of a member.
@jjohnstn please try this:
package test;
public class Foo {
static record Pair<T> (T left, T right) {}
String test (Pair<String> p) {
return p.left();
}
}
When I tried this right now, I happened to be in Build id: I20231217-1800
Thanks @stephan-herrmann that did it. My test is similar but I didn't access the record component.
I had this rocket-science record defined as a nested type:
Then I decided this should be a util available for others too: Refactor > Move to new file: