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

Type operator lhs against expected type #11428

Merged
merged 1 commit into from
Dec 16, 2023

Conversation

Simn
Copy link
Member

@Simn Simn commented Dec 13, 2023

For #10981

I don't know if this is acceptable behavior, but I'm already not sure if #2786 was acceptable behavior (and we subsequently ran into problems in #4914).

It just seems quite random to type the operands against the expected return type. I'd kind of understand typing them against the argument types of the @:op function, but that wouldn't work for the EnumFlags case because there the lhs is the underlying type, Int.

@Simn
Copy link
Member Author

Simn commented Dec 13, 2023

On balance, I'm fine with merging this because while I still think #2786 might have been a mistake, we're now at least consistent with regards to unification behavior. What I said about argument types vs. return types stands, but that's a fight for another day.

@skial skial mentioned this pull request Dec 13, 2023
1 task
@Simn Simn merged commit af369a7 into development Dec 16, 2023
121 of 122 checks passed
@Simn Simn deleted the type_operator_lhs_against_expected_abstract branch December 16, 2023 09:02
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.

1 participant