Community
Participate
Working Groups
In my null annotation implementation I had code like this protected class ReturnStatement extends NodeWithBits playedBy ReturnStatement { Expression getExpression() -> get Expression expression; FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) <- replace FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo); callin FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { if (this.expression != null) { this.expression.analyseCode(currentScope, flowContext, flowInfo); ... The generated code triggered a VerifyError because the inferred c-t-f for this.exression (last line) bogusly tried to lower the receiver (this) to the base version of ReturnStatement. It seems the compiler couldn't decide whether to use the existing explicit c-t-f (use this) or to directly access the base field (use lower(this)). OTOH, also lowering for the argument currentScope had a finger in the pie (workaround: make this lowering explicit). This could indicate that the loweringRequired flag was consumed at a wrong location. Might/might not be related to bug 352914 or bug 353894 comment 13.
VerifyError is bad, schedule for M2.
This was closed by accident. The error can still be reproduced.
This is what caused the error: - lowering of the BlockScope arg caused Config.requireTypeAdjustment() which triggered the InsertTypeAdjustmentsVisitor - inside InsertTypeAdjustmentsVisitor a lowering conversion was inserted for the fieldReference this.expression The fix consists of one additional check: - don't add lowering conversion for a field reference that already has a syntheticAccessor w/ purpose InferredCalloutToField Released for 2.2 M2 via commit 47700cc09e0d3152088b67bbb6920af31adc19d2.
Verified using 2.2 M5