bug: ParentNotInitializedException in AbstractTypingContext#adaptType()
- Dominant language
- Java
- Stars
- 2k
- Forks
- 392
- Avg merge
- 11h 24m
- Merged PRs (30d)
- 36
Description
[This line](https://github.com/INRIA/spoon/blob/7abce70c8b5742f5e2f1bc59151871dd1d2050c6/src/main/java/spoon/support/visitor/AbstractTypingContext.java#L49) throws an exception when the `result` is a CtTypeReference without a parent, but with type parameters. And "standard" types from a `TypeFactory` don't have parents.
It's also kinda connected to #3733:
1. Type reference for `java.lang.Object` gets corrupted with type parameters
2. `getBound()` returns the corrupted type reference for `java.lang.Object` [here](https://github.com/INRIA/spoon/blob/7abce70c8b5742f5e2f1bc59151871dd1d2050c6/src/main/java/spoon/support/visitor/MethodTypingContext.java#L244)
3. The corrupted type reference destroys `adaptType()` because it doesn't have a parent as a "standard" type in a `TypeFactory`
I haven't managed to make a minimal reproducible sample and can't share the main code, sorry.
Contributor guide
Assessment
This issue has not been assessed yet.