From c04bf229fcf1eb92749059e4049f507d49efe299 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 15 May 2015 13:42:26 +0200 Subject: [PATCH] Dropped ??? in arrayclass The patch caused the built dotty not to run anymore. Since the prupose of the ??? was to find out where it was called I inserted the stacktrace that caused dotc to fail. I wonder how this passed the tests? Dotc became completely useless for me when I ran it from the command line. --- src/scala/runtime/ScalaRunTime.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/scala/runtime/ScalaRunTime.scala b/src/scala/runtime/ScalaRunTime.scala index b875b4d1e910..ed1eb82b1b10 100644 --- a/src/scala/runtime/ScalaRunTime.scala +++ b/src/scala/runtime/ScalaRunTime.scala @@ -50,7 +50,13 @@ object ScalaRunTime { /** Return the class object representing an array with element class `clazz`. */ def arrayClass(clazz: jClass[_]): jClass[_] = { - ??? // Dmitry: I want to see where this method is used to know how to fix it + // Dmitry: I want to see where this method is used to know how to fix it + // [Martin] Here's a stacktrace + // Exception in thread "main" scala.NotImplementedError: an implementation is missing + // at scala.Predef$.$qmark$qmark$qmark(Predef.scala:225) + // at scala.runtime.ScalaRunTime$.arrayClass(ScalaRunTime.scala:53) + // at scala.Array$.fill(Array.scala:281) + // at dotty.tools.dotc.core.Flags$.(Flags.scala:139) // newInstance throws an exception if the erasure is Void.TYPE. see SI-5680 if (clazz == java.lang.Void.TYPE) classOf[Array[Unit]] else java.lang.reflect.Array.newInstance(clazz, 0).getClass