diff --git a/library/src-3.x/scala/internal/Quoted.scala b/library/src-3.x/scala/internal/Quoted.scala index 0b649d196da7..25af38de4c9a 100644 --- a/library/src-3.x/scala/internal/Quoted.scala +++ b/library/src-3.x/scala/internal/Quoted.scala @@ -1,27 +1,28 @@ package scala.internal -import scala.annotation.Annotation +import scala.annotation.{Annotation, compileTimeOnly} import scala.quoted._ object Quoted { /** A term quote is desugared by the compiler into a call to this method */ - def exprQuote[T](x: T): Expr[T] = - throw new Error("Internal error: this method call should have been replaced by the compiler") + @compileTimeOnly("Illegal reference to `scala.internal.Quoted.exprQuote`") + def exprQuote[T](x: T): Expr[T] = ??? /** A term splice is desugared by the compiler into a call to this method */ - def exprSplice[T](x: Expr[T]): T = - throw new Error("Internal error: this method call should have been replaced by the compiler") + @compileTimeOnly("Illegal reference to `scala.internal.Quoted.exprSplice`") + def exprSplice[T](x: Expr[T]): T = ??? /** A type quote is desugared by the compiler into a call to this method */ - def typeQuote[T <: AnyKind]: Type[T] = - throw new Error("Internal error: this method call should have been replaced by the compiler") + @compileTimeOnly("Illegal reference to `scala.internal.Quoted.typeQuote`") + def typeQuote[T <: AnyKind]: Type[T] = ??? /** A splice in a quoted pattern is desugared by the compiler into a call to this method */ - def patternHole[T]: T = - throw new Error("Internal error: this method call should have been replaced by the compiler") + @compileTimeOnly("Illegal reference to `scala.internal.Quoted.patternHole`") + def patternHole[T]: T = ??? /** A splice of a name in a quoted pattern is desugared by wrapping getting this annotation */ + @compileTimeOnly("Illegal reference to `scala.internal.Quoted.patternBindHole`") class patternBindHole extends Annotation }