The `OperatorHelper.getPromotedType` is not implemented for the `instanceof` operator
Open
- Dominant language
- Java
- Stars
- 2k
- Forks
- 392
- Avg merge
- 11h 24m
- Merged PRs (30d)
- 36
Description
The code was introduced in #5291 and the method is not used with the `instanceof` operator, because an `instanceof` with two literals is very rare. One could have `"a" instanceof String`, but I am not sure how the class on the right hand side is represented in Spoon.
https://github.com/INRIA/spoon/blob/5d6a2d3e81333c700dce690da5eb9f5a7ba068c6/src/main/java/spoon/reflect/visitor/OperatorHelper.java#L390-L393
The implementation is not trivial (one would have to check if a type is reifiable), which is why it is not yet implemented: https://github.com/INRIA/spoon/pull/5291#discussion_r1243209544
Contributor guide
Assessment
This issue has not been assessed yet.