Skip to content

Hook up effect modeling for TypeVar and UnionAll #48063

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

Merged
merged 2 commits into from
Jan 2, 2023
Merged

Hook up effect modeling for TypeVar and UnionAll #48063

merged 2 commits into from
Jan 2, 2023

Conversation

Keno
Copy link
Member

@Keno Keno commented Dec 31, 2022

We already had effect modeling for _typevar, which TypeVar should just defer to. Add a simple model for UnionAll as well, though in the future we can add the Vararg case also.

@Keno Keno requested a review from aviatesk December 31, 2022 18:58
We already had effect modeling for `_typevar`, which `TypeVar` should
just defer to. Add a simple model for `UnionAll` as well, though
in the future we can add the Vararg case also.
if isa(a3, Const)
body = a3.val
elseif isType(a3)
body = a3.parameters[1]
canconst = false
else
return Any
return CallMeta(Any, Effects(EFFECTS_TOTAL; nothrow), NoCallInfo())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return CallMeta(Any, Effects(EFFECTS_TOTAL; nothrow), NoCallInfo())
return CallMeta(Any, EFFECTS_THROWS, NoCallInfo())

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one I think in theory could be proven nothrow, even if we don't model the rt.

Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
@Keno Keno merged commit 7a561bd into master Jan 2, 2023
@Keno Keno deleted the kf/tueffects branch January 2, 2023 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants