Skip to content

Commit 2b99240

Browse files
committed
Make AbstractPrimitiveFieldLocation non-sealed to fix javac error when casting to com.oracle.truffle.api.object.BooleanLocation
1 parent df1f42d commit 2b99240

File tree

1 file changed

+11
-1
lines changed
  • truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object

1 file changed

+11
-1
lines changed

truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/ExtLocations.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,17 @@ long getOffset() {
747747
}
748748
}
749749

750-
abstract static sealed class AbstractPrimitiveFieldLocation extends InstanceLocation implements FieldLocation {
750+
/**
751+
* Non-sealed because there used to be BooleanFieldLocation and Graal.js still uses
752+
* {@link com.oracle.truffle.api.object.BooleanLocation}. If sealed it would cause a javac
753+
* error:
754+
*
755+
* <pre>
756+
* .../PropertySetNode.java:577: error: incompatible types: Location cannot be converted to BooleanLocation
757+
* this.location = (com.oracle.truffle.api.object.BooleanLocation) property.getLocation();
758+
* </pre>
759+
*/
760+
abstract static non-sealed class AbstractPrimitiveFieldLocation extends InstanceLocation implements FieldLocation {
751761

752762
protected final FieldInfo field;
753763

0 commit comments

Comments
 (0)