Skip to content

Commit 75a7a27

Browse files
committed
Give more details when an object location is no longer suitable
1 parent 6c019fb commit 75a7a27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/truffleruby/language/objects/WriteObjectFieldNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void writeExistingField(DynamicObject object, Object value, boolean gener
9797
}
9898
} catch (IncompatibleLocationException | FinalLocationException e) {
9999
// remove this entry
100-
validLocation.invalidate();
100+
validLocation.invalidate("for " + location + " for existing ivar " + name + " at " + getEncapsulatingSourceSection());
101101
// Generalization is handled by Shape#defineProperty as the field already exists
102102
executeWithGeneralize(object, value, generalize);
103103
}
@@ -137,7 +137,7 @@ public void writeNewField(DynamicObject object, Object value, boolean generalize
137137
}
138138
} catch (IncompatibleLocationException e) {
139139
// remove this entry
140-
validLocation.invalidate();
140+
validLocation.invalidate("for " + location + " for new ivar " + name + " at " + getEncapsulatingSourceSection());
141141
// Make sure to generalize when adding a new field and the value is incompatible.
142142
// So writing an int and then later a double generalizes to adding an Object field.
143143
executeWithGeneralize(object, value, true);

0 commit comments

Comments
 (0)