KEMBAR78
[mypyc] Coerce Register assignments by jhance · Pull Request #11176 · python/mypy · GitHub
Skip to content

Conversation

jhance
Copy link
Collaborator

@jhance jhance commented Sep 22, 2021

Fixes mypyc/mypyc#759 and probably some other issues. Including only
the change to coerce the Register assignments fixes the missing
type coercion for the specialized next-generator case, but causes some
unusual box-then-unbox from short_ints.

These odd coercions are caused by the dict keys in dict literals being
considered short_int, but dict_next_rtuple_single/pair return types bein
annotated as int_primitive. Changing this to short_int_rprimitive removes
the odd coercisions. The remainder of the diff is fixing the irbuild
testcase output to have short_int.

Fixes mypyc/mypyc#759 and probably some other issues. Including only
the change to coerce the Register assignments fixes the missing
type coercion for the specialized next-generator case, but causes some
unusual box-then-unbox from short_ints.

These odd coercions are caused by the dict keys in dict literals being
considered short_int, but dict_next_rtuple_single/pair return types bein
annotated as int_primitive. Changing this to short_int_rprimitive removes
the odd coercisions. The remainder of the diff is fixing the irbuild
testcase output to have short_int.
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

LGTM

@JukkaL JukkaL merged commit 2aebd4c into python:master Sep 22, 2021
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.

Missing type coercion in next op

2 participants