Dyno: fix disambiguation between fully-generic vararg and less generic non-vararg. #26456
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 fixes an issue discovered in domain module code, in which the following program was considered to be ambiguous:
This program is not actually ambiguous, which can be seen by making an appeal to "desugaring" of the vararg version to its non-vararg form:
The first version of
foo
is fully-generic, while the second is more constrained (it requires an integral type). As a result, the second version is more specific. Dyno didn't detect this because generic vararg formal are given generic tuple types, while the "is fully generic" check was looking for any type. Adjust this by detecting vararg formals and changing the check accordingly.Reviewed @arezaii -- thanks!
Testing