diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/t6323a.check | 9 | ||||
-rw-r--r-- | test/files/neg/t6323a.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t6323a.scala (renamed from test/files/run/t6323.scala) | 2 | ||||
-rw-r--r-- | test/files/run/t6323b.check (renamed from test/files/run/t6323.check) | 0 | ||||
-rw-r--r-- | test/files/run/t6323b.scala | 21 |
5 files changed, 32 insertions, 1 deletions
diff --git a/test/files/neg/t6323a.check b/test/files/neg/t6323a.check new file mode 100644 index 0000000000..694c79ca5f --- /dev/null +++ b/test/files/neg/t6323a.check @@ -0,0 +1,9 @@ +t6323a.scala:11: `package`.this.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[Test] because:
+failed to typecheck the materialized tag:
+cannot create a TypeTag referring to local class Test.Test
+ val value = u.typeOf[Test]
+ ^
+t6323a.scala:11: error: No TypeTag available for Test
+ val value = u.typeOf[Test]
+ ^
+one error found
diff --git a/test/files/neg/t6323a.flags b/test/files/neg/t6323a.flags new file mode 100644 index 0000000000..4c6cdb71e2 --- /dev/null +++ b/test/files/neg/t6323a.flags @@ -0,0 +1 @@ +-Xlog-implicits
\ No newline at end of file diff --git a/test/files/run/t6323.scala b/test/files/neg/t6323a.scala index 625cfaae20..a203167f3c 100644 --- a/test/files/run/t6323.scala +++ b/test/files/neg/t6323a.scala @@ -15,7 +15,7 @@ object Test extends App { val thisShouldBeA = aAccessor.apply() println(thisShouldBeA) } catch { - case ScalaReflectionException(msg) => println(msg) + case ScalaReflectionException(msg) => println(msg) } } }
\ No newline at end of file diff --git a/test/files/run/t6323.check b/test/files/run/t6323b.check index 2219278a16..2219278a16 100644 --- a/test/files/run/t6323.check +++ b/test/files/run/t6323b.check diff --git a/test/files/run/t6323b.scala b/test/files/run/t6323b.scala new file mode 100644 index 0000000000..25a2329d94 --- /dev/null +++ b/test/files/run/t6323b.scala @@ -0,0 +1,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.absTypeOf[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) + } + } +}
\ No newline at end of file |