scala.compiletime.testing

Type members

Classlikes

final case class Error(message: String, lineContent: String, column: Int, kind: ErrorKind)
Represents a compile-time error.
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
(source)
sealed trait ErrorKind
An error can be either a parse-time or a typecheck-time
Companion
object
Source
(source)
object ErrorKind
Companion
class
Source
(source)

Value members

Methods

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.
Value Params
code
The code to be type checked
Returns
a list of errors encountered during parsing and typechecking. The code should be a sequence of expressions or statements that may appear in a block.
Source
(source)
inline def typeChecks(inline code: String): Boolean
Whether the code type checks in the current context?
Value Params
code
The code to be type checked
Returns
false if the code has syntax error or type error in the current context, otherwise returns true. The code should be a sequence of expressions or statements that may appear in a block.
Source
(source)