-
Notifications
You must be signed in to change notification settings - Fork 37
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
Missing coercion in ternary operator #1220
Labels
Bug
Something isn't working
Comments
On further consideration, I think this is ok to leave as is, I don't think this actually a bug, C++ has the same issue when returning an |
That said, #1143 needs coercion for ternary, too, so that fix will address this too. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using a
Null
as a value in a ternary operator it does not seem to be coerced to the correct type.I would expect
Null
to be coerced to anoptional<uint8>
here but instead I seeAt least in this example we should be able derive some target type from the first branch of the ternary. The same approach seems to break down for ternaries where
Null
appears as first branch; if we do not want to change how types for ternaries are resolved (e.g., from the use of the whole expression), we might need to introduce support for users to specify a type of aNull
(currently we only support creating set optionals -- still with implicitly derived type).The workaround is to use a typed
Null
value,The text was updated successfully, but these errors were encountered: