-
Notifications
You must be signed in to change notification settings - Fork 118
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
[EA] New value type (bool) is not matching the resolved parameter type #1930
Comments
Based on what I see in #1935, the issue is that |
@Simbiat The line you noted in your comment can't produce In the other issue you referenced, the variable is being assigned to an item from |
It's not about whether it's proper boolean or just false, it's the fact that you can have a situation, when |
i'm not sure how the interpreter could see |
Most likely the logic is "go through every variable/value in the expression, and fail on first one that may not match the type". Depending on complexity of the expression, there may not be a easy way to get all possible combinations. But again, we probably should be doing something to interpret all of them. That's why I say that this may be expected behavior, not that it is. |
Given this code, inspection will detect
diff()
as potentially returning "bool
", not strictlyfalse
, so it may cause a type issue.But since the only Boolean that can be expected is
false
and it's handled by?:
to a properly typed value, there should be no warning - no possible type collision.Bear in mind, this is an example of the issue - it's not exclusive to this set of functions.
Expected Result
A couple things:
date_create()
with an arbitrary string argument may returnfalse
but no warning is raised when it's passed todiff()
.false
return fromdiff()
is handled by a substitute (?:
to a default orthrow
expression, for instance), the warning should be canceled.Environment details
Screenshot
The text was updated successfully, but these errors were encountered: