You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
Currently in the jballerina implementation, the following sample is allowed
float r =true?1:1;
But the spec doesn't mention propagating the CET of the conditional expression to the then else expressions. Should we add this to the spec or change the implementation?
The text was updated successfully, but these errors were encountered:
It seems like we have more expressions similar to this that the spec doesn't mention propagating the CET to the sub-expressions.
int a =checkpanicdependentlyTypedFunc();
float b =letintx=5inx*2;
float|error c =trap2;
future<int>b=startdependentlyTypedFunc(); // Currenly gives error due to other reason
Generally the spec only says anything about propagating the conditionally expected type when it's not obvious how it should be propagated. When the spec says nothing about how to propagate the contextually expected type, you should do the obvious thing, rather than do nothing. Same goes for static typing rules. In an ideal world it would spell all this out, but realistically that isn't going to happen any time soon.
In these cases, I would say it's obvious what to do...
Description:
Currently in the jballerina implementation, the following sample is allowed
But the spec doesn't mention propagating the CET of the conditional expression to the then else expressions. Should we add this to the spec or change the implementation?
The text was updated successfully, but these errors were encountered: