Skip to content

Instantly share code, notes, and snippets.

@syedatifakhtar
Created November 22, 2016 12:12
Show Gist options
  • Save syedatifakhtar/e5a3b7e2a4fca9e2e6e879809c0a78ab to your computer and use it in GitHub Desktop.
Save syedatifakhtar/e5a3b7e2a4fca9e2e6e879809c0a78ab to your computer and use it in GitHub Desktop.
Scala reflection gist for preparedStatement DBUtil reflection
val someMap = Map(
typeTag[scala.math.BigDecimal].tpe -> 0
)
def someFun[A: TypeTag](value: Option[A]): Unit = {
val someType = typeTag[scala.math.BigDecimal]
val myType = someType.tpe
val targ: _root_.scala.reflect.runtime.universe.Type = typeOf[A]
println(s"TARG: ${targ.normalize} and mytpe = ${myType}")
val typeTagValue: _root_.scala.reflect.runtime.universe.TypeTag[A] = typeTag[A]
println(someMap.get(targ.normalize))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment