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 {
1299
1299
}
1300
1300
1301
1301
/** 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
+ */
1305
1305
def staticRef (path : Name , generateStubs : Boolean = true , isPackage : Boolean = false )(using Context ): Denotation = {
1306
1306
def select (prefix : Denotation , selector : Name ): Denotation = {
1307
1307
val owner = prefix.disambiguate(_.info.isParameterless)
Original file line number Diff line number Diff line change @@ -462,15 +462,14 @@ object Phases {
462
462
* Enrich crash messages.
463
463
*/
464
464
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
+ && {
467
467
try {body; true }
468
468
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} " ))
470
470
throw ex
471
471
finally ctx.run.advanceUnit()
472
- else
473
- false
472
+ }
474
473
475
474
inline def runSubPhase [T ](id : Run .SubPhase )(inline body : (Run .SubPhase , Context ) ?=> T )(using Context ): T =
476
475
given Run .SubPhase = id
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ object TastyFileUtil {
15
15
* package foo
16
16
* class Foo
17
17
* ```
18
- * then `getClassName ("./out/foo/Foo.tasty") returns `Some("./out")`
18
+ * then `getClassPath ("./out/foo/Foo.tasty") returns `Some("./out")`
19
19
*/
20
20
def getClassPath (file : AbstractFile ): Option [String ] =
21
21
getClassName(file).map { className =>
@@ -32,19 +32,16 @@ object TastyFileUtil {
32
32
* ```
33
33
* then `getClassName("./out/foo/Foo.tasty") returns `Some("foo.Foo")`
34
34
*/
35
- def getClassName (file : AbstractFile ): Option [String ] = {
35
+ def getClassName (file : AbstractFile ): Option [String ] =
36
36
assert(file.exists)
37
37
assert(file.extension == " tasty" )
38
38
val bytes = file.toByteArray
39
39
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}"
48
45
}
49
46
50
47
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
9
9
import dotty .tools .dotc .Compiler
10
10
import dotty .tools .dotc .Driver
11
11
import dotty .tools .dotc .Run
12
- import dotty .tools .dotc .core .Contexts .Context
12
+ import dotty .tools .dotc .core .Contexts .{ Context , ctx }
13
13
import dotty .tools .dotc .core .Mode
14
14
import dotty .tools .dotc .core .Phases .Phase
15
15
import dotty .tools .dotc .fromtasty ._
@@ -69,7 +69,7 @@ object TastyInspector:
69
69
override def phaseName : String = " tastyInspector"
70
70
71
71
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
73
73
val ctx = QuotesCache .init(ctx0.fresh)
74
74
runOnImpl(units)(using ctx)
75
75
You can’t perform that action at this time.
0 commit comments