ExprDecoder

io.github.iltotore.iron.macros.ReflectUtil.ExprDecoder
See theExprDecoder companion trait
object ExprDecoder

Attributes

Companion
trait
Source
ReflectUtil.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Givens

Givens

A boolean ExprDecoder that can extract value from partially inlined || and && operations.

A boolean ExprDecoder that can extract value from partially inlined || and && operations.

 inline val x = true
 val y: Boolean = ???

 x || y //inlined to `true`
 y || x //inlined to `true`

 inline val a = false
 val b: Boolean = ???

 a && b //inlined to `false`
 b && a //inlined to `false`

Attributes

Source
ReflectUtil.scala

A String ExprDecoder that can extract value from concatenated strings if all arguments are compile-time-extractable strings.

A String ExprDecoder that can extract value from concatenated strings if all arguments are compile-time-extractable strings.

 inline val x = "a"
 inline val y = "b"
 val z = "c"

 x + y //"ab"
 x + z //DecodingFailure
 z + x //DecodingFailure

Attributes

Source
ReflectUtil.scala
given given_ExprDecoder_T[T](using fromExpr: FromExpr[T]): given_ExprDecoder_T[T]

Fallback expression decoder instance using Dotty's FromExpr. Fails with a DecodingFailure.NotInlined if the underlying FromExpr returns None.

Fallback expression decoder instance using Dotty's FromExpr. Fails with a DecodingFailure.NotInlined if the underlying FromExpr returns None.

Attributes

Source
ReflectUtil.scala
given given_ExprDecoder_T[T <: NumConstant | Byte | Short : Type]: ExprDecoder[T]

Decoder for all primitives except for String and Boolean which benefit from some enhancements.

Decoder for all primitives except for String and Boolean which benefit from some enhancements.

Type parameters

T

the type of the expression to decodeExpr

Attributes

Source
ReflectUtil.scala