Skip to content

Commit ee00a1d

Browse files
committed
Indicate the the errors are compiler bugs
1 parent c561b11 commit ee00a1d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

library/src/scala/compiletime/package.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ package object compiletime {
5757
*/
5858
transparent inline def code (inline args: Any*): String =
5959
// implemented in dotty.tools.dotc.typer.Inliner.Intrinsics
60-
error("`code` was not evaluated by the compiler")
60+
error("Compiler bug: `code` was not evaluated by the compiler")
6161

6262
end extension
6363

@@ -77,22 +77,22 @@ package object compiletime {
7777
*/
7878
inline def requireConst(inline x: Boolean | Byte | Short | Int | Long | Float | Double | Char | String): Unit =
7979
// implemented in dotty.tools.dotc.typer.Inliner
80-
error("`requireConst` was not evaluated by the compiler")
80+
error("Compiler bug: `requireConst` was not evaluated by the compiler")
8181

8282
/** Same as `constValue` but returns a `None` if a constant value
8383
* cannot be constructed from the provided type. Otherwise returns
8484
* that value wrapped in `Some`.
8585
*/
8686
inline def constValueOpt[T]: Option[T] =
8787
// implemented in dotty.tools.dotc.typer.Inliner
88-
error("`constValueOpt` was not evaluated by the compiler")
88+
error("Compiler bug: `constValueOpt` was not evaluated by the compiler")
8989

9090
/** Given a constant, singleton type `T`, convert it to a value
9191
* of the same singleton type. For example: `assert(constValue[1] == 1)`.
9292
*/
9393
inline def constValue[T]: T =
9494
// implemented in dotty.tools.dotc.typer.Inliner
95-
error("`constValue` was not evaluated by the compiler")
95+
error("Compiler bug: `constValue` was not evaluated by the compiler")
9696

9797
/** Given a tuple type `(X1, ..., Xn)`, returns a tuple value
9898
* `(constValue[X1], ..., constValue[Xn])`.
@@ -120,7 +120,7 @@ package object compiletime {
120120
* the returned value would be `2`.
121121
*/
122122
transparent inline def summonFrom[T](f: Nothing => T): T =
123-
error("`summonFrom` was not evaluated by the compiler")
123+
error("Compiler bug: `summonFrom` was not evaluated by the compiler")
124124

125125
/** Summon a given value of type `T`. Usually, the argument is not passed explicitly.
126126
* The summoning is delayed until the call has been fully inlined.

library/src/scala/compiletime/testing/package.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ package object testing {
1212
*/
1313
inline def typeChecks(inline code: String): Boolean =
1414
// implemented in package dotty.tools.dotc.typer.Inliner.Intrinsics
15-
error("`typeChecks` was not checked by the compiler")
15+
error("Compiler bug: `typeChecks` was not checked by the compiler")
1616

1717
/** Whether the code type checks in the current context? If not,
1818
* returns a list of errors encountered on compilation.
@@ -29,5 +29,5 @@ package object testing {
2929
*/
3030
inline def typeCheckErrors(inline code: String): List[Error] =
3131
// implemented in package dotty.tools.dotc.typer.Inliner.Intrinsics
32-
error("`typeCheckErrors` was not checked by the compiler")
32+
error("Compiler bug: `typeCheckErrors` was not checked by the compiler")
3333
}

0 commit comments

Comments
 (0)