Closed Nadeeshan96 closed 1 year ago
are we going to consider handling ambiguities in structural constructors too, so that it will not give an ambiguity error during the compilation, like in the above case, and to choose the inherent type using some policy?
I have considered and rejected this idea.
The situation for a constructor and for fromJsonWithType is different. With fromJsonWithType, we have to do the best we can with the type we have (since that may come from JSON schema). With a constructor, it's simpler and more reliable for the user to be explicit about what they want.
Got it. Thanks!
Description:
Because the spec on the mapping constructor says
we do not allow the following.
Like we have a first match policy to handle ambiguities in
fromJsonWithType
now https://github.com/ballerina-platform/ballerina-spec/issues/1088, are we going to consider handling ambiguities in structural constructors too, so that it will not give an ambiguity error during the compilation, like in the above case, and to choose the inherent type using some policy?Suggested Labels:
Code sample that shows issue:
Related Issues: