You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (varrecordComponent : originalClass.getRecordComponents()) {
650
-
if (WordBase.class.isAssignableFrom(recordComponent.getType())) {
651
-
throwUserError.abort("Records cannot use Word types. " +
652
-
"The equals/hashCode/toString implementation of records uses method handles, and Word types are not supported as parameters of method handle invocations. " +
653
-
"Record type: `" + originalClass.getTypeName() + "`, component: `" + recordComponent.getName() + "` of type `" + recordComponent.getType().getTypeName() + "`");
649
+
try {
650
+
for (varrecordComponent : originalClass.getRecordComponents()) {
651
+
if (WordBase.class.isAssignableFrom(recordComponent.getType())) {
652
+
throwUserError.abort("Records cannot use Word types. " +
653
+
"The equals/hashCode/toString implementation of records uses method handles, and Word types are not supported as parameters of method handle invocations. " +
654
+
"Record type: `" + originalClass.getTypeName() + "`, component: `" + recordComponent.getName() + "` of type `" + recordComponent.getType().getTypeName() + "`");
655
+
}
654
656
}
657
+
} catch (LinkageErrore) {
658
+
/*
659
+
* If a record refers to a missing/incomplete type then Class.getRecordComponents()
660
+
* will throw a LinkageError. It's safe to ignore this here since the Word type
661
+
* restriction applies to VM classes which should be fully defined.
Copy file name to clipboardExpand all lines: substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/serialize/SerializationFeature.java
+30-14Lines changed: 30 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -527,11 +527,17 @@ private void registerForSerialization(ConfigurationCondition cnd, Class<?> seria
0 commit comments