-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different data type in case statement #40
Comments
I can't imagine why a case would want to return two different datatypes. The expressions system doesn't support variable type expressions and I think the first case should define the type for the subsequent ones. I believe that's how getExprType figures out the type of case expressions. |
Baye defon is an enum set? Definitely shouldn't be a return type along with
Ho General
…On 27 December 2017 at 11:01, Rajesh Sharma ***@***.***> wrote:
here is the case that brought this up. The if statement is a text type and
else is enumset
Works as expected when the cases are reversed. That's the solution I
replied to him.
[image: screen shot 2017-12-27 at 12 06 15 pm]
<https://user-images.githubusercontent.com/46905/34386111-34ccdf96-eb4f-11e7-9c40-d0062e5368cf.png>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABLlP-nFwiI8OagYRoFoAtqYicg8aczBks5tEmnwgaJpZM4RNV9Z>
.
|
Yes "Baye defon" is an enum set. But since the first case is a text type. Its treated as text, and the ids of the enum values from "Baye defon" are shown. |
Ya, definitely shouldn't be allowed. All later "thens" should be forced to be same type as first. There is a "Convert to text" function for cases like this where an enum needs to become a plain text string. |
closed with the updates here #63 |
When cases in expressions are of different data type, currently we are only looking at the first one. This causes issues when we have different types.
eg. text type in case 0 and enumset in case 1.
If the second condition is met, the enum values are not transformed
The text was updated successfully, but these errors were encountered: