summaryrefslogtreecommitdiff
path: root/test/files/neg/t6323a.scala
blob: a203167f3c1e50a7612cd1bef7e957987a6fdac9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => m}
import scala.reflect.runtime.{universe => u}

object Test extends App {
  locally {
    try {
      case class Test(a:String,b:List[Int])

      val lookAtMe = m.reflect(Test("a",List(5)))
      val value = u.typeOf[Test]
      val members = value.members
      val member = value.members.filter(_.name.encoded == "a")
      val aAccessor = lookAtMe.reflectMethod(member.head.asMethod)
      val thisShouldBeA = aAccessor.apply()
      println(thisShouldBeA)
    } catch {
      case ScalaReflectionException(msg) => println(msg)
    }
  }
}