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

fix calls to implicitly generic params in generic contexts #24246

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Oct 5, 2024

There were a couple remaining bugs after #24005, #24065 for proc parameters with implicit generic types:

  • A new check containsUnresolvedType was introduced that purposefully excluded typeclasses, but implicitly generic proc params can have typeclass type annotated with tfImplicitTypeParam. To fix this, we include tfImplicitTypeParam and tfGenericTypeParam into the flags that are considered unresolved (previously only tfUnresolved).
  • x is T where x has an unresolved type only delayed evaluation if x was a type itself, i.e. it didn't work properly if x is a regular value. This is now fixed by performing the same check for both non-typedesc types and typedesc types.

@metagn
Copy link
Collaborator Author

metagn commented Oct 9, 2024

The code mentioned in this bullet point is removed now along with the bullet point:

  • or, and, not types and old concept types (along with some others) get preferential treatment in typeRel if they are the matching type rather than the type being matched. This is done because typeclasses like these normally would not match any concrete types otherwise, but the delaying of generic calls depends on this expected behavior. To fix this, these types are not matched whatsoever in calls in generic contexts if they are the matching type.

This was already done more generally in #24123.

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