Introduce MethodTypeKind to quotes reflection API#20249
Merged
nicolasstucki merged 2 commits intoscala:mainfrom Apr 25, 2024
Merged
Introduce MethodTypeKind to quotes reflection API#20249nicolasstucki merged 2 commits intoscala:mainfrom
nicolasstucki merged 2 commits intoscala:mainfrom
Conversation
It allows to create Contextual and Implicit MethodTypes. MethodTypeKind abstracts away the MethodTypeCompanion implementation into a simple enum style choice for a newly added MethodType apply. The MethodType unapply is kept as it was for source compatibility, instead users are encouraged to use isImplicit and isContextual methods.
nicolasstucki
approved these changes
Apr 24, 2024
sjrd
reviewed
Apr 24, 2024
| given MethodOrPolyTypeTest: TypeTest[TypeRepr, MethodOrPoly] | ||
|
|
||
| /** Type which decides on the kind of parameter list represented by `MethodType`. */ | ||
| type MethodTypeKind |
Member
There was a problem hiding this comment.
Have you considered making this a concrete, static enum instead?
Contributor
There was a problem hiding this comment.
In this case, it could work.
Contributor
|
This has been decided to be included in the 3.5.0 release. |
Contributor
Author
|
I have changed the implementation to use enums. I guess this is better - users get nicer pattern matching and the MethodTypeCompanion is also better hidden (printlns on MethodTypeKind will be less confusing) |
sjrd
approved these changes
Apr 25, 2024
nicolasstucki
approved these changes
Apr 25, 2024
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.
It allows to create Contextual and Implicit MethodTypes. MethodTypeKind abstracts away the
MethodTypeCompanionimplementation into a simple enum style choice for a newly added MethodType apply method. The MethodType unapply is kept as it was for source compatibility, instead users are encouraged to useisImplicitandisContextualmethods.Based on #18499
Fixes #18477