-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update type constraint checks in VerifyRetNonNullC
Summary: VerifyRetNonNullC is emitted when the statically known return type passes all constraints modulo nullability. This diff expands the type constraint checks in VerifyRetNonNullC to cover upper bounds. The logic to further simplify and infer the output type of this bytecode is udpated as follows: 1. If the static type can never be null, VerifyRetNonNullC is redundant and can be removed. 2. If the static type is null, then check: a. if there is any constraint that will fatal (i.e. non-nullable, non-soft), mark as unreachable . b. if all non-nullable constraints are soft, then the nullability of the type cannot be further refined 3. If the nullability of the type is not statically known, then we can assume that the output type is not null as long as all constraints are non-soft non-nullable. Reviewed By: jano Differential Revision: D70006138 fbshipit-source-id: a95fac508bb3223ff563c0c382941d87f3273033
- Loading branch information
1 parent
544915a
commit 1efcd2f
Showing
4 changed files
with
28 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters