From 65f4a2e97e30f3d369f94b818bfc574c76d5956a Mon Sep 17 00:00:00 2001 From: Thushara-Piyasekara Date: Tue, 9 Apr 2024 17:52:21 +0530 Subject: [PATCH] Fix immutable BFields not being marked as readonly --- .../io/ballerina/runtime/internal/values/ReadOnlyUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/ReadOnlyUtils.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/ReadOnlyUtils.java index 5e527b31679f..0231e94d03c4 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/ReadOnlyUtils.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/ReadOnlyUtils.java @@ -224,8 +224,8 @@ private static BIntersectionType setImmutableIntersectionType(Type type, Set entry : originalFields.entrySet()) { Field originalField = entry.getValue(); fields.put(entry.getKey(), - new BField(getImmutableType(originalField.getFieldType(), unresolvedTypes), - originalField.getFieldName(), originalField.getFlags())); + new BField(getImmutableType(originalField.getFieldType(), unresolvedTypes), + originalField.getFieldName(), originalField.getFlags() | SymbolFlags.READONLY)); } BRecordType immutableRecordType = new BRecordType(