Prefer module methods over Any
instance ones
#12048
Merged
+145
−16
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.
Pull Request Description
While working on #12031 it turned out that
Meta.is_a
and extension methodAny.is_a
clash. It makes little sense to treat module's associated type as a value, and as such let's prefer static methods for these associated types. By doing this we refine:those PRs define preference of
Any
instance methods over regular types static method ones. E.g. with the integration of this PR the behavior depends on type being associated with a module or being a regular type. That's desirable as regular types often refine instance methods defined onAny
while types associated with a module override nothing, but rather serve as a container for module (static) methods.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
style guides. In case you are using a language not listed above, follow the Rust style guide.