Skip to content
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

review type checks that should be tautologically true #5737

Open
sethbrenith opened this issue Oct 1, 2018 · 0 comments
Open

review type checks that should be tautologically true #5737

sethbrenith opened this issue Oct 1, 2018 · 0 comments
Labels

Comments

@sethbrenith
Copy link
Contributor

As @Penguinwizzard mentioned here,

This feels like there's a few situations in which a smart compiler would be able to make it always return true - e.g. with a static build and ltcg, I think it may be legal to optimize the "GetTypeId() == mytypeid" ::Is() checks for various object types in our type system to always return true when working on the same type as that passed in - since there's no avenue other than UB to change the typeid of valid objects of that pointer type to something else. Since we're already doing effectively that, it's not a regression with this change, but in a future change we'll most likely want to change this to being closer to VarIs in terms of signature, with the exception of making the last line AssertOrFailFast(VarIsImpl<T>(obj)).

This issue is a reminder to come back to check on calls to VarIsCorrectType.

@sethbrenith sethbrenith self-assigned this Oct 1, 2018
@dilijev dilijev added the Task label Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants