2013-06-18から1日間の記事一覧
ConstantType Scalaには7.typeのような型(constant type)がこっそり含まれていた。macroで取り出して使うことができる。 object ConstantTypeOf { type apply[T](x: T) = macro impl[T] def impl[T: c.WeakTypeTag](c: Context)(x: c.Expr[T]): c.Tree = { i…
ConstantType Scalaには7.typeのような型(constant type)がこっそり含まれていた。macroで取り出して使うことができる。 object ConstantTypeOf { type apply[T](x: T) = macro impl[T] def impl[T: c.WeakTypeTag](c: Context)(x: c.Expr[T]): c.Tree = { i…