|
1 | 1 | package scala.internal
|
2 | 2 |
|
3 |
| -import scala.annotation.Annotation |
| 3 | +import scala.annotation.{Annotation, compileTimeOnly} |
4 | 4 | import scala.quoted._
|
5 | 5 |
|
6 | 6 | object Quoted {
|
7 | 7 |
|
8 | 8 | /** A term quote is desugared by the compiler into a call to this method */
|
9 |
| - def exprQuote[T](x: T): Expr[T] = |
10 |
| - throw new Error("Internal error: this method call should have been replaced by the compiler") |
| 9 | + @compileTimeOnly("Illegal reference to `scala.internal.Quoted.exprQuote`") |
| 10 | + def exprQuote[T](x: T): Expr[T] = ??? |
11 | 11 |
|
12 | 12 | /** A term splice is desugared by the compiler into a call to this method */
|
13 |
| - def exprSplice[T](x: Expr[T]): T = |
14 |
| - throw new Error("Internal error: this method call should have been replaced by the compiler") |
| 13 | + @compileTimeOnly("Illegal reference to `scala.internal.Quoted.exprSplice`") |
| 14 | + def exprSplice[T](x: Expr[T]): T = ??? |
15 | 15 |
|
16 | 16 | /** A type quote is desugared by the compiler into a call to this method */
|
17 |
| - def typeQuote[T <: AnyKind]: Type[T] = |
18 |
| - throw new Error("Internal error: this method call should have been replaced by the compiler") |
| 17 | + @compileTimeOnly("Illegal reference to `scala.internal.Quoted.typeQuote`") |
| 18 | + def typeQuote[T <: AnyKind]: Type[T] = ??? |
19 | 19 |
|
20 | 20 | /** A splice in a quoted pattern is desugared by the compiler into a call to this method */
|
21 |
| - def patternHole[T]: T = |
22 |
| - throw new Error("Internal error: this method call should have been replaced by the compiler") |
| 21 | + @compileTimeOnly("Illegal reference to `scala.internal.Quoted.patternHole`") |
| 22 | + def patternHole[T]: T = ??? |
23 | 23 |
|
24 | 24 | /** A splice of a name in a quoted pattern is desugared by wrapping getting this annotation */
|
| 25 | + @compileTimeOnly("Illegal reference to `scala.internal.Quoted.patternBindHole`") |
25 | 26 | class patternBindHole extends Annotation
|
26 | 27 |
|
27 | 28 | }
|
0 commit comments