blob: b9765ebb62ecda4708526391da6cd42f8cf3a4e6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{universe => ru}
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
object Test extends dotty.runtime.LegacyApp {
class MyQuerycollection{
def findUserByName( name:String ) = {
val tree = reify{ "test" == name }.tree
val toolbox = cm.mkToolBox()
toolbox.typecheck(tree) match{
case Apply(Select(lhs,op),rhs::Nil) =>
println(rhs.tpe)
}
}
}
val qc = new MyQuerycollection
qc.findUserByName("some value")
}
|