Add comment about const check (#859)

This commit is contained in:
Daniel Chao
2024-12-23 11:38:33 -08:00
committed by GitHub
parent 6fd82a5bb8
commit a014e8d1d1

View File

@@ -118,6 +118,9 @@ public abstract class ReadPropertyNode extends ExpressionNode {
.build();
}
// only ever need to check once per node because `needsConst` is only true in the case of implicit
// receivers inside class (and module) bodies, and the const-ness of a resolved property cannot be
// changed by subclasses.
private void checkConst(VmObjectLike receiver) {
if (needsConst && !isConstChecked) {
CompilerDirectives.transferToInterpreterAndInvalidate();