summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-12 12:24:08 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-09-14 13:29:48 +0200
commit524c90d09f2fb4687b312f2c7597393978d50b6a (patch)
tree1badec2cf5d0cf4ce3769d69af225005b7bc550e /test/files/run
parent0eabb63c06f4041077860875c9ea71216adf4faa (diff)
downloadscala-524c90d09f2fb4687b312f2c7597393978d50b6a.tar.gz
scala-524c90d09f2fb4687b312f2c7597393978d50b6a.tar.bz2
scala-524c90d09f2fb4687b312f2c7597393978d50b6a.zip
SI-6323 outlaws free types from TypeTag
Free types are no longer acceptable in normal type tags. Like type parameters or abstract type members they don't map on any real type, therefore I think this is a justified change. The main reason for doing is this is to prohibit people from using `typeOf` on local classes. Sure, the guard introduced in the previous commit will raise runtime errors about that, but this commit provides static checking. Those especially persistent might use `absTypeOf` and then try to play around with the weak type it returns, but that's advanced usage scenario, and I don't worry much about it. Bottom line: `typeOf` should just work. Things that work with additional effort should be explicitly marked as such.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t6323b.check (renamed from test/files/run/t6323.check)0
-rw-r--r--test/files/run/t6323b.scala (renamed from test/files/run/t6323.scala)4
2 files changed, 2 insertions, 2 deletions
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/t6323.scala b/test/files/run/t6323b.scala
index 625cfaae20..25a2329d94 100644
--- a/test/files/run/t6323.scala
+++ b/test/files/run/t6323b.scala
@@ -8,14 +8,14 @@ object Test extends App {
case class Test(a:String,b:List[Int])
val lookAtMe = m.reflect(Test("a",List(5)))
- val value = u.typeOf[Test]
+ 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)
+ case ScalaReflectionException(msg) => println(msg)
}
}
} \ No newline at end of file