--- a/src/Pure/General/untyped.scala Tue Dec 02 16:10:11 2014 +0100
+++ b/src/Pure/General/untyped.scala Tue Dec 02 16:40:11 2014 +0100
@@ -20,8 +20,8 @@
}
}
- def get(obj: AnyRef, x: String): AnyRef =
- if (obj == null) null
+ def get[A](obj: AnyRef, x: String): A =
+ if (obj == null) null.asInstanceOf[A]
else {
val iterator =
for {
@@ -32,7 +32,7 @@
field.setAccessible(true)
field.get(obj)
}
- if (iterator.hasNext) iterator.next
+ if (iterator.hasNext) iterator.next.asInstanceOf[A]
else error("No field " + quote(x) + " for " + obj)
}
}