Fixes instance checking and elaboration for members which return closures#313
Merged
rodrigogribeiro merged 3 commits intomainfrom Jan 26, 2026
Merged
Fixes instance checking and elaboration for members which return closures#313rodrigogribeiro merged 3 commits intomainfrom
rodrigogribeiro merged 3 commits intomainfrom
Conversation
This was referenced Jan 16, 2026
mbenke
requested changes
Jan 23, 2026
* We type check the code twice: one with no desugaring enabled and another with the command line options. * Changed the ambiguity check in order to not consider invokable constraints when the option of no desugaring indirect calls is enabled. This is necessary because if no desugaring calls is enabled, no invokable instance is generated. Thus, no invokable constraint can be entailed in this situation.
89d813e to
7026b4c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #302 .
The strategy is to type the code twice: first we run the type inference without any desugaring. This is necessary becase code with closures will change its type. Such desugaring strategy is a problematic in the presence of type signatures, since the infered type for the desugared term will not match the annotated type. The strategy is detect all possible errors in the first step and then desugar and annotate all terms in the second one.