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
@MichaReiser - Do you think it's feasible to use the unreachable code graph to implement this?
Using the control flow graph is an option. Although I fear that building the control flow graph just for this might be a bit overkill because we aren't interested in control flows, but only care about exit nodes of the function. I would need to look into it again but from what I remember is that Hindley milner is AST based. We could potentially implement a subset of it. But it heavily depends on how accurate the type analysis should be.
## Summary
Adds detection for branches without a `return` or `raise`, so that we
can properly `Optional` the return types. I'd like to remove this and
replace it with our code graph analysis from the `unreachable.rs` rule,
but it at least fixes the worst offenders.
Closes#8942.
Given:
We infer a return type of
int
, rather thanOptional[int]
.The text was updated successfully, but these errors were encountered: