You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
spoon-core version: 8.3.0
Code to reproduce the bug:
importspoon.Launcher;
importspoon.reflect.declaration.CtClass;
importspoon.reflect.declaration.CtElement;
publicclassA {
publicstaticvoidmain(String[] args) {
CtClassl = Launcher.parseClass("class A { { int x = switch(1) { case 1, 3 -> 0; default -> 1}; } }");
for (CtElementa : l.asIterable()) {
a.getParent();
}
}
}
Exception in thread "main" spoon.reflect.declaration.ParentNotInitializedException: parent not initialized for class spoon.support.reflect.code.CtLiteralImpl (unknown file)
at spoon.support.reflect.declaration.CtElementImpl.getParent(CtElementImpl.java:366)
at A.main(A.java:9)
The CtLiteralImpl which represents the number 3 throws a ParentNotInitializedException when getting its parent. I guess that is not intended behaviour.
The text was updated successfully, but these errors were encountered:
spoon-core version: 8.3.0
Code to reproduce the bug:
The CtLiteralImpl which represents the number 3 throws a ParentNotInitializedException when getting its parent. I guess that is not intended behaviour.
The text was updated successfully, but these errors were encountered: