Open prakanth97 opened 1 year ago
import ballerina/io;
type FooRec1 record {
map<json> j;
};
type FooRec3 record {
FooRec1 fooRec?;
};
public function main() returns error? {
FooRec3 rec2 = {fooRec: {j: {k: "3", l: {m: "4"}}}};
json val = check rec2.fooRec?.j.k;
io:println(val); // prints 3
}
If the field type is map<json>
, the obtained output matches with the expected outcome.
Description
expected result for
val
is3
but got{"k":"3","l":{"m":"4"}}
Steps to Reproduce
No response
Affected Version(s)
Master 2201.3.0
OS, DB, other environment details and versions
No response
Related area
-> Compilation
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response