Skip to content

Commit

Permalink
Revert basic type check
Browse files Browse the repository at this point in the history
  • Loading branch information
heshanpadmasiri committed Dec 22, 2023
1 parent 72de51a commit 8e1c43d
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2490,12 +2490,10 @@ private boolean isOptionalBasicTypeFieldAssignment(BLangAssignment assignNode) {
}
BRecordType recordType = (BRecordType) targetType;
BField field = recordType.fields.get(fieldAccessNode.field.value);
if (field == null || (field.symbol.flags & Flags.OPTIONAL) != Flags.OPTIONAL) {
if (field == null) {
return false;
}
BType fieldType = field.getType();
return fieldType.getKind() == TypeKind.BOOLEAN || fieldType.getKind() == TypeKind.FLOAT ||
TypeTags.isIntegerTypeTag(fieldType.tag);
return (field.symbol.flags & Flags.OPTIONAL) == Flags.OPTIONAL;
}

@Override
Expand Down

0 comments on commit 8e1c43d

Please sign in to comment.