Skip to content

Commit ab2ed31

Browse files
authored
Add a utility "className" on Type (#16165)
2 parents fa1cbb0 + 50a9dd1 commit ab2ed31

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/src/dotty/tools/dotc/core/Decorators.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ object Decorators {
274274
s"[cannot display due to $msg, raw string = $x]"
275275
case _ => String.valueOf(x).nn
276276

277+
/** Returns the simple class name of `x`. */
278+
def className: String = getClass.getSimpleName.nn
279+
277280
extension [T](x: T)
278281
def assertingErrorsReported(using Context): T = {
279282
assert(ctx.reporter.errorsReported)

0 commit comments

Comments
 (0)