scala.compiletime.testing

Members list

Type members

Classlikes

final case class Error(message: String, lineContent: String, column: Int, kind: ErrorKind)

Represents a compile-time error.

Represents a compile-time error.

Value parameters

column

the zero-based column position within lineContent where the error occurred

kind

the phase in which the error occurred, either ErrorKind.Parser or ErrorKind.Typer

lineContent

the source line containing the error

message

the error message produced by the compiler

Attributes

See also

scala.compiletime.testing.typeCheckErrors IMPORTANT: No stability guarantees are provided on the format of these errors. This means the format and the API may change from version to version. This API is to be used for testing purposes only.

Source
Error.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait ErrorKind

An error can be either a parse-time or a typecheck-time.

An error can be either a parse-time or a typecheck-time.

Attributes

Companion
object
Source
ErrorKind.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Parser
object Typer
object ErrorKind

Attributes

Companion
trait
Source
ErrorKind.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
ErrorKind.type

Value members

Concrete methods

transparent inline def typeCheckErrors(inline code: String): List[Error]

Whether the code type checks in the current context? If not, returns a list of errors encountered on compilation. IMPORTANT: No stability guarantees are provided on the format of these errors. This means the format and the API may change from version to version. This API is to be used for testing purposes only.

Whether the code type checks in the current context? If not, returns a list of errors encountered on compilation. IMPORTANT: No stability guarantees are provided on the format of these errors. This means the format and the API may change from version to version. This API is to be used for testing purposes only.

An inline definition with a call to typeCheckErrors should be transparent.

Value parameters

code

a string literal containing the Scala code to type-check at compile time

Attributes

Returns

an empty list if the code type-checks successfully, or a list of Error values describing the errors encountered during parsing and type-checking. The code should be a sequence of expressions or statements that may appear in a block.

Source
package.scala
transparent inline def typeChecks(inline code: String): Boolean

Whether the code type checks in the current context?

Whether the code type checks in the current context?

An inline definition with a call to typeChecks should be transparent.

Value parameters

code

a string literal containing the Scala code to type-check at compile time

Attributes

Returns

true if the code type-checks successfully, false if the code has a syntax or type error in the current context. The code should be a sequence of expressions or statements that may appear in a block.

Source
package.scala