[Bug]: The typeOf
API returns a compilation error type for some expressions when attached to return statement
#42009
Labels
Area/SemanticAPI
Semantic API Related Issues #Compiler
Reason/EngineeringMistake
The issue occurred due to a mistake made in the past.
Team/CompilerFE
All issues related to Language implementation and Compiler, this exclude run times.
Type/Bug
Milestone
Description
When certain expressions, such as query expressions and conditional expressions, are attached to the return statement, the
typeOf
API returns the compilation error type instead of evaluating the type. However, the expected result is accurately generated for literals and other expressions, such as logical expressions.Steps to Reproduce
Provide the line position between the
<START>
and<END
to thetypeOf
API of the semantic modelAffected Version(s)
Ballerina 2201.8.4 (Swan Lake Update 8)
OS, DB, other environment details and versions
OS: macOS 14.2.1 23C71
JDK: openjdk 17.0.8 2023-07-18
Related area
-> Compilation
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: