Dotty Documentation

0.18.0-bin-SNAPSHOT

package scala.compiletime
extends Object with Serializable

[-] Constructors

[-] Members

[+] type S = Nothing <: Int
[+] @Body inline def code ( self: => StringContext ) ( args: => [ Any ] ) : String

Returns the string representations for code passed in the interpolated values

inline def logged(p1: => Any) = {
  val c = code"code: $p1"
  val res = p1
  (c, p1)
}
logged(indentity("foo"))

is equivalent to:

("code: indentity("foo")", indentity("foo"))
[+] @Body inline def constValue : T
[+] @Body inline def constValueOpt : Option [ T ]
[+] erased def erasedValue : T
[+] @Body inline def error ( msg: String ) : Nothing

The error method is used to produce user-defined compile errors during inline expansion. If an inline expansion results in a call error(msgStr) the compiler produces an error message containing the given msgStr.

error("My error message")

or

error(code"My error of this code: ${println("foo")}")