Skip to content

Commit 40d29d6

Browse files
committed
Polishings
1 parent 27f9856 commit 40d29d6

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import printing.{ Printer, Showable }, printing.Formatting._, printing.Texts._
1111
import transform.MegaPhase
1212
import reporting.{Message, NoExplanation}
1313

14-
/** This object provides useful implicit decorators for types defined elsewhere */
14+
/** This object provides useful extension methods for types defined elsewhere */
1515
object Decorators {
1616

1717
/** Extension methods for toType/TermName methods on PreNames.

compiler/src/dotty/tools/dotc/reporting/Message.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import scala.annotation.threadUnsafe
1515

1616
/** ## Tips for error message generation
1717
*
18-
* - You can use the `em` interpolator for error messages. It's defined in decorators.
18+
* - You can use the `em` interpolator for error messages. It's defined in core.Decorators.
1919
* - You can also use a simple string argument for `error` or `warning` (not for the other variants),
2020
* but the string should not be interpolated or composed of objects that require a
2121
* Context for evaluation.
2222
* - When embedding interpolated substrings defined elsewhere in error messages,
23-
* make sure they are defined as def's instead of vals. That way, the
23+
* use `i` and make sure they are defined as def's instead of vals. That way, the
2424
* possibly expensive interpolation will performed only in the case where the message
2525
* is eventually printed. Note: At least during typer, it's common for messages
2626
* to be discarded without being printed. Also, by making them defs, you ensure that

compiler/src/dotty/tools/package.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
package dotty
22

33
package object tools {
4-
// Ensure this object is already classloaded, since it's only actually used
5-
// when handling stack overflows and every operation (including class loading)
6-
// risks failing.
7-
dotty.tools.dotc.core.handleRecursive
84

95
val ListOfNil: List[Nil.type] = Nil :: Nil
106

@@ -49,4 +45,9 @@ package object tools {
4945
val e = if msg == null then AssertionError() else AssertionError("assertion failed: " + msg)
5046
e.setStackTrace(Array())
5147
throw e
52-
}
48+
49+
// Ensure this object is already classloaded, since it's only actually used
50+
// when handling stack overflows and every operation (including class loading)
51+
// risks failing.
52+
dotty.tools.dotc.core.handleRecursive
53+
}

0 commit comments

Comments
 (0)