Skip to content

Add a utility "className" extension #16165

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

Merged
merged 2 commits into from
Nov 12, 2022
Merged

Conversation

dwijnand
Copy link
Member

Working with LazyRef, TypeVars and so forth, it's often unclear from
RefinedPrinter's show what classes types are. So I often want to see
the implementing class. But the fully-qualified name is extreme, and
even the simple name can be trimmed down a touch. So I'd love to have
this implemented once so I can reuse it.

@dwijnand dwijnand marked this pull request as ready for review October 13, 2022 14:54
@Kordyjan Kordyjan requested a review from odersky October 17, 2022 14:33
@dwijnand dwijnand requested review from Kordyjan and removed request for odersky October 25, 2022 22:29
@dwijnand dwijnand assigned SethTisue and unassigned Kordyjan Nov 7, 2022
@dwijnand dwijnand requested review from SethTisue and removed request for Kordyjan November 7, 2022 20:40
@SethTisue
Copy link
Member

perhaps I lack context for why this is really worth having, but it seems rather dubious to me. I can see that the post-processing you're doing on the output of getSimpleName could save space in debugging output — do I understand rightly that that's the motivation? — but dropping $ and Impl and Real and so forth seems like a dangerous source of potential confusion to me

@dwijnand
Copy link
Member Author

First and foremost it's to have a shorthand of getClass.getSimpleName. So I can drop the rest of the trimming, as that's of lesser value.

Working with LazyRef, TypeVars and so forth, it's often unclear from
RefinedPrinter's show what classes types are.  So I often want to see
the implementing class.  But the fully-qualified name is extreme, and
even the simple name can be trimmed down a touch.  So I'd love to have
this implemented once so I can reuse it.
@dwijnand dwijnand merged commit ab2ed31 into scala:main Nov 12, 2022
@dwijnand dwijnand deleted the Type.className branch November 12, 2022 12:07
@dwijnand dwijnand changed the title Add a utility "className" on Type Add a utility "className" extension Nov 12, 2022
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.

3 participants