Even after ensuring type, the compiler does not pick up the variable #42593
Labels
Team/CompilerFE
All issues related to Language implementation and Compiler, this exclude run times.
Type/Question
Description:
A record type has a nullable attribute, It can either be a string or a null. In the code, I checked the attribute is a string, but within the if condition, I cannot treat the variable as a string. the compiler still picks up the variable as a string or null.
Steps to reproduce:
Record type :
Code:
Error:
incompatible types: expected 'string', found 'string?'
Affected Versions:
Ballerina 2201.8.4
OS, DB, other environment details and versions:
Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):
The text was updated successfully, but these errors were encountered: