summaryrefslogtreecommitdiff
path: root/src/library/scala/Float.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-06-22 21:10:33 +0000
committerPaul Phillips <paulp@improving.org>2011-06-22 21:10:33 +0000
commit9853b5b8292650d8e192b500e636dc441550eef7 (patch)
treeec3a85b9b7af29c9fbd3bba17389791f083394cc /src/library/scala/Float.scala
parente49ec10e93eeec1af775096de07dd46a7d0a1fad (diff)
downloadscala-9853b5b8292650d8e192b500e636dc441550eef7.tar.gz
scala-9853b5b8292650d8e192b500e636dc441550eef7.tar.bz2
scala-9853b5b8292650d8e192b500e636dc441550eef7.zip
A total rewrite of "runtimeClass", discarding t...
A total rewrite of "runtimeClass", discarding the user-space approach in favor of simply fixing getClass. def f1 = 5.getClass // Class[Int] def f2 = (5: AnyVal).getClass // Class[_ <: AnyVal] def f3 = (5: java.lang.Integer).getClass // Class[_ <: java.lang.Integer] class A class B extends A def f1 = (new B: Any).getClass().newInstance() // Any def f2 = (new B: AnyRef).getClass().newInstance() // AnyRef def f3 = (new B: A).getClass().newInstance() // A def f4 = (new B: B).getClass().newInstance() // B But that's not all! def f0[T >: B] = (new B: T).getClass().newInstance() def f5 = f0[Any] // Any def f6 = f0[AnyRef] // AnyRef def f7 = f0[A] // A def f8 = f0[B] // B Closes #490, #896, #4696. Review by moors. (Note: I think this is pretty good, but picky review requested.)
Diffstat (limited to 'src/library/scala/Float.scala')
-rw-r--r--src/library/scala/Float.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/library/scala/Float.scala b/src/library/scala/Float.scala
index f403e5ccab..9ef7181806 100644
--- a/src/library/scala/Float.scala
+++ b/src/library/scala/Float.scala
@@ -118,6 +118,7 @@ final class Float extends AnyVal {
def %(x: Float): Float = sys.error("stub")
def %(x: Double): Double = sys.error("stub")
+ def getClass(): Class[Float] = sys.error("stub")
}
object Float extends AnyValCompanion {