File tree Expand file tree Collapse file tree 5 files changed +18
-20
lines changed
compiler/src/dotty/tools/dotc
scaladoc-testcases/src/tests
scaladoc/src/scala/tasty/inspector Expand file tree Collapse file tree 5 files changed +18
-20
lines changed Original file line number Diff line number Diff line change @@ -1299,9 +1299,9 @@ object Denotations {
12991299 }
13001300
13011301 /** The current denotation of the static reference given by path,
1302- * or a MissingRef or NoQualifyingRef instance, if it does not exist.
1303- * if generateStubs is set, generates stubs for missing top-level symbols
1304- */
1302+ * or a MissingRef or NoQualifyingRef instance, if it does not exist.
1303+ * if generateStubs is set, generates stubs for missing top-level symbols
1304+ */
13051305 def staticRef (path : Name , generateStubs : Boolean = true , isPackage : Boolean = false )(using Context ): Denotation = {
13061306 def select (prefix : Denotation , selector : Name ): Denotation = {
13071307 val owner = prefix.disambiguate(_.info.isParameterless)
Original file line number Diff line number Diff line change @@ -462,15 +462,14 @@ object Phases {
462462 * Enrich crash messages.
463463 */
464464 final def monitor (doing : String )(body : Context ?=> Unit )(using Context ): Boolean =
465- val unit = ctx.compilationUnit
466- if ctx.run.enterUnit(unit) then
465+ ctx.run.enterUnit(ctx. compilationUnit)
466+ && {
467467 try {body; true }
468468 catch case NonFatal (ex) if ! ctx.run.enrichedErrorMessage =>
469- report.echo(ctx.run.enrichErrorMessage(s " exception occurred while $doing $unit " ))
469+ report.echo(ctx.run.enrichErrorMessage(s " exception occurred while $doing ${ctx.compilationUnit} " ))
470470 throw ex
471471 finally ctx.run.advanceUnit()
472- else
473- false
472+ }
474473
475474 inline def runSubPhase [T ](id : Run .SubPhase )(inline body : (Run .SubPhase , Context ) ?=> T )(using Context ): T =
476475 given Run .SubPhase = id
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ object TastyFileUtil {
1515 * package foo
1616 * class Foo
1717 * ```
18- * then `getClassName ("./out/foo/Foo.tasty") returns `Some("./out")`
18+ * then `getClassPath ("./out/foo/Foo.tasty") returns `Some("./out")`
1919 */
2020 def getClassPath (file : AbstractFile ): Option [String ] =
2121 getClassName(file).map { className =>
@@ -32,19 +32,16 @@ object TastyFileUtil {
3232 * ```
3333 * then `getClassName("./out/foo/Foo.tasty") returns `Some("foo.Foo")`
3434 */
35- def getClassName (file : AbstractFile ): Option [String ] = {
35+ def getClassName (file : AbstractFile ): Option [String ] =
3636 assert(file.exists)
3737 assert(file.extension == " tasty" )
3838 val bytes = file.toByteArray
3939 val names = new TastyClassName (bytes).readName()
40- names.map { case (packageName, className) =>
41- val fullName = packageName match {
42- case EMPTY_PACKAGE => s " ${className.lastPart}"
43- case _ => s " $packageName. ${className.lastPart}"
44- }
45- fullName
46- }
47- }
40+ names.map: (packageName, className) =>
41+ if packageName == EMPTY_PACKAGE then
42+ s " ${className.lastPart.encode}"
43+ else
44+ s " ${packageName.encode}. ${className.lastPart.encode}"
4845}
4946
5047
Original file line number Diff line number Diff line change 1+
2+ def exampleMember = " hello, world"
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import scala.quoted.runtime.impl.QuotesImpl
99import dotty .tools .dotc .Compiler
1010import dotty .tools .dotc .Driver
1111import dotty .tools .dotc .Run
12- import dotty .tools .dotc .core .Contexts .Context
12+ import dotty .tools .dotc .core .Contexts .{ Context , ctx }
1313import dotty .tools .dotc .core .Mode
1414import dotty .tools .dotc .core .Phases .Phase
1515import dotty .tools .dotc .fromtasty ._
@@ -69,7 +69,7 @@ object TastyInspector:
6969 override def phaseName : String = " tastyInspector"
7070
7171 override def runOn (units : List [CompilationUnit ])(using ctx0 : Context ): List [CompilationUnit ] =
72- // NOTE: although this is a phase, do not expect this to be ran with an xsbti.CompileProgress
72+ // NOTE: although this is a phase, do not expect this to be run with an xsbti.CompileProgress
7373 val ctx = QuotesCache .init(ctx0.fresh)
7474 runOnImpl(units)(using ctx)
7575
You can’t perform that action at this time.
0 commit comments