Open xlight05 opened 3 months ago
Looks like a lang issue.
import ballerina/lang.value;
type Person record {|
int id;
string name;
|};
public function main() {
future<Person|error>[] arr = [];
map<json> p = {name: "Joy", id: 1100};
future<Person|error> ft = start value:cloneWithType(p, Person);
arr.push(ft);
}
Also fails at runtime with
error: {ballerina/lang.array}InherentTypeViolation {"message":"incompatible types: expected 'future<(Person|error)>', found 'future<(anydata|error)>'"}
at ballerina.lang.array.0:push(array.bal:419)
test:main(test.bal:31)
Description: $Subject
Consider the code below :
This doesn't have any compile errors but it gives following error in the runtime.
Please move to lang repo if this should be handled in the lang level. Steps to reproduce:
Affected Versions:
OS, DB, other environment details and versions:
Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):