Skip to content

Commit e870c41

Browse files
committed
changed method name to be more descriptive
1 parent 95f38af commit e870c41

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/tastyreflect/ReflectionCompilerInterface.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
6565
def Context_requiredClass(self: Context)(path: String): Symbol = self.requiredClass(path)
6666
def Context_requiredModule(self: Context)(path: String): Symbol = self.requiredModule(path)
6767
def Context_requiredMethod(self: Context)(path: String): Symbol = self.requiredMethod(path)
68-
def Context_getJavaClassname(self: Context): Option[String] =
68+
def Context_javaCompilationUnitClassname(self: Context): Option[String] =
6969
self.compilationUnit match {
7070
case j: fromtasty.JavaCompilationUnit => Some(j.className)
7171
case _ => None

library/src/scala/tasty/Reflection.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
474474
def requiredMethod(path: String): Symbol = internal.Context_requiredMethod(self)(path)
475475

476476
/** Get Java class name if we've accidentally tried to reflect on a Java class. None returned if TASTy class. */
477-
def getJavaClassname(): Option[String] = internal.Context_getJavaClassname(self)
477+
def javaCompilationUnitClassname(): Option[String] = internal.Context_javaCompilationUnitClassname(self)
478478

479479
}
480480

library/src/scala/tasty/reflect/CompilerInterface.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ trait CompilerInterface {
163163
def Context_requiredMethod(self: Context)(path: String): Symbol
164164

165165
/** Get Java class name if we've accidentally tried to reflect on a Java class. None returned if TASTy class. */
166-
def Context_getJavaClassname(self: Context): Option[String]
166+
def Context_javaCompilationUnitClassname(self: Context): Option[String]
167167

168168

169169
///////////////

tests/run-custom-args/tasty-inspector/i8215.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ class TestInspector() extends TastyInspector
2121

2222
protected def processCompilationUnit(reflect: Reflection)(root: reflect.Tree): Unit =
2323
import reflect.{given,_}
24-
gotJava = reflect.rootContext.getJavaClassname()
24+
gotJava = reflect.rootContext.javaCompilationUnitClassname()

0 commit comments

Comments
 (0)