diff options
author | Sébastien Doeraene <sjrdoeraene@gmail.com> | 2016-04-13 14:55:02 +0200 |
---|---|---|
committer | Sébastien Doeraene <sjrdoeraene@gmail.com> | 2016-04-13 16:20:46 +0200 |
commit | 8fc0516d6deeb84af9bac5370f1d21511e0f86d6 (patch) | |
tree | 74ee8fdc85c8c7fc8e8e21b954a34e8781044475 /test | |
parent | 51996c8474a06656f8c21302af2b4151bdc2393e (diff) | |
download | scala-8fc0516d6deeb84af9bac5370f1d21511e0f86d6.tar.gz scala-8fc0516d6deeb84af9bac5370f1d21511e0f86d6.tar.bz2 scala-8fc0516d6deeb84af9bac5370f1d21511e0f86d6.zip |
Inline ScalaRunTime.arrayElementClass at call sites.
This method was awful. Not only it was using run-time type
tests to essentially encode compile-time overloading. But
it also did 2 slightly different things for the Class case
and ClassTag case.
All in all, it is much more readable to inline the
appropriate implementation at every call site.
Diffstat (limited to 'test')
-rw-r--r-- | test/instrumented/library/scala/runtime/ScalaRunTime.scala | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/test/instrumented/library/scala/runtime/ScalaRunTime.scala b/test/instrumented/library/scala/runtime/ScalaRunTime.scala index 6e758abde0..7bd94ef7ca 100644 --- a/test/instrumented/library/scala/runtime/ScalaRunTime.scala +++ b/test/instrumented/library/scala/runtime/ScalaRunTime.scala @@ -45,15 +45,6 @@ object ScalaRunTime { else java.lang.reflect.Array.newInstance(clazz, 0).getClass } - /** Return the class object representing elements in arrays described by a given schematic. - */ - def arrayElementClass(schematic: Any): jClass[_] = schematic match { - case cls: jClass[_] => cls.getComponentType - case tag: ClassTag[_] => tag.runtimeClass - case _ => - throw new UnsupportedOperationException(s"unsupported schematic $schematic (${schematic.getClass})") - } - /** Return the class object representing an unboxed value type, * e.g. classOf[int], not classOf[java.lang.Integer]. The compiler * rewrites expressions like 5.getClass to come here. |