Repository navigation
Avoid crashing for an inlined Java annot with a default value - #27095
Conversation
tanishiking
left a comment
There was a problem hiding this comment.
While this avoids the compiler crash, I'm not sure filling null instead of the default value is an expected behavior.
On top of that, in this case we are putting null where a primitive value is expected (unfilledDefault2), so it fails at runtime with Caused by: java.lang.VerifyError: Bad type on operand stack.
TBH, I'm not yet sure I am not yet sure what should we do / should this work in the first place 🤔
34cbaef to
bff5ac7
Compare
|
@tanishiking you're right, thanks... I discussed this with Seb offline and he suggested that anything a macro creates that you couldn't write yourself isn't supported. So I changed this PR to report an error instead. |
som-snytt
left a comment
There was a problem hiding this comment.
I had the same question about ersatz trees. It may be fine in backend, but normally it's errorTree for a tree with ErrorType. (As opposed to EmptyTree as a placeholder.) I just wonder about interactions with unsuspecting plugins or whatever. Reporting an error may not stop the world?
Good question, I don't think we have a general way to deal with this anyway. If someone has a plugin affected by this we can figure it out. |
tanishiking
left a comment
There was a problem hiding this comment.
LGTM! Yeah, emit error makes more sense 👍
Fixes #27078
I don't like this. But what else can we do?
Have you relied on LLM-based tools in this contribution?
No
How was the solution tested?
New automated tests (including the issue's reproducer, if applicable)