summaryrefslogtreecommitdiff
path: root/src/dotnet-library
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2007-12-21 14:42:31 +0000
committermichelou <michelou@epfl.ch>2007-12-21 14:42:31 +0000
commitc6f96a7ef30be23a8d3cda6fcaa0c0563a9373bb (patch)
treeceba2822ca118aba3b58285eb1c496dcc3690c27 /src/dotnet-library
parentb186613b3e9e65197d855f0924c211844d91be68 (diff)
downloadscala-c6f96a7ef30be23a8d3cda6fcaa0c0563a9373bb.tar.gz
scala-c6f96a7ef30be23a8d3cda6fcaa0c0563a9373bb.tar.bz2
scala-c6f96a7ef30be23a8d3cda6fcaa0c0563a9373bb.zip
updated MSIL library for class[T]
Diffstat (limited to 'src/dotnet-library')
-rw-r--r--src/dotnet-library/scala/Predef.scala16
-rw-r--r--src/dotnet-library/scala/compat/Platform.scala6
-rw-r--r--src/dotnet-library/scala/runtime/RichClass.scala10
-rw-r--r--src/dotnet-library/scala/runtime/RichException.scala4
-rw-r--r--src/dotnet-library/scala/runtime/RichInt.scala2
5 files changed, 17 insertions, 21 deletions
diff --git a/src/dotnet-library/scala/Predef.scala b/src/dotnet-library/scala/Predef.scala
index f03be9ed93..82dfb658f5 100644
--- a/src/dotnet-library/scala/Predef.scala
+++ b/src/dotnet-library/scala/Predef.scala
@@ -1,6 +1,6 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** / __/ __// _ | / / / _ | (c) 2002-2008, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
@@ -21,7 +21,7 @@ object Predef {
// classOf dummy ------------------------------------------------------
/** Return the runtime representation of a class type. */
- def classOf[T]: Class = null
+ def classOf[T]: Class[T] = null
// aliases ------------------------------------------------------------
@@ -35,14 +35,9 @@ object Predef {
type boolean = scala.Boolean
type unit = scala.Unit
- /** @deprecated use <code>Nothing</code> instead */
- @deprecated type All = Nothing
- /** @deprecated use <code>Null</code> instead */
- @deprecated type AllRef = Null
-
type String = System.String
type StringBuilder = compat.StringBuilder
- type Class = System.Type
+ type Class[T] = System.Type
type Runnable = scala.runtime.Runnable
type Throwable = System.Exception
@@ -176,10 +171,11 @@ object Predef {
implicit def exceptionWrapper(exc: Throwable) = new runtime.RichException(exc)
final class GetClassWrapper(obj: AnyRef) {
- def getClass(): runtime.RichClass = classWrapper(obj.GetType())
+ def getClass(): runtime.RichClass[Any] = classWrapper(obj.GetType())
}
implicit def getClassWrapper(obj: AnyRef) = new GetClassWrapper(obj)
- implicit def classWrapper(clazz: Class): runtime.RichClass = new runtime.RichClass(clazz)
+ implicit def classWrapper[A](clazz: Class[A]): runtime.RichClass[A] =
+ new runtime.RichClass(clazz)
implicit def unit2ordered(x: Unit): Ordered[Unit] = new Ordered[Unit] with Proxy {
def self: Any = x
diff --git a/src/dotnet-library/scala/compat/Platform.scala b/src/dotnet-library/scala/compat/Platform.scala
index 7d5ec48b67..6caac5b781 100644
--- a/src/dotnet-library/scala/compat/Platform.scala
+++ b/src/dotnet-library/scala/compat/Platform.scala
@@ -1,6 +1,6 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** / __/ __// _ | / / / _ | (c) 2002-2008, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
@@ -39,14 +39,14 @@ object Platform {
* @param length ..
* @return ..
*/
- def createArray(elemClass: Class, length: Int): AnyRef =
+ def createArray(elemClass: Class[_], length: Int): AnyRef =
System.Array.CreateInstance(elemClass, length)
def arrayclear(arr: Array[Int]) {
System.Array.Clear(arr.asInstanceOf[System.Array], 0, arr.length)
}
- def getClassForName(name: String): Class = System.Type.GetType(name)
+ def getClassForName(name: String): Class[_] = System.Type.GetType(name)
val EOL = System.Environment.NewLine
diff --git a/src/dotnet-library/scala/runtime/RichClass.scala b/src/dotnet-library/scala/runtime/RichClass.scala
index 0c18a4aecd..fc21f537ac 100644
--- a/src/dotnet-library/scala/runtime/RichClass.scala
+++ b/src/dotnet-library/scala/runtime/RichClass.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2008, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -13,13 +13,13 @@ package scala.runtime
import Predef.Class
-final class RichClass(val self: Class) extends Proxy {
+final class RichClass[A](val self: Class[A]) extends Proxy {
def isPrimitive(): Boolean = self.IsPrimitive
def isArray(): Boolean = self.IsArray
- def getClass(): RichClass = this
+ def getClass(): RichClass[A] = this
def getName(): String = self.Name
- def getComponentType(): Class = self.GetElementType
+ def getComponentType(): Class[A] = self.GetElementType
}
diff --git a/src/dotnet-library/scala/runtime/RichException.scala b/src/dotnet-library/scala/runtime/RichException.scala
index ebc7ddd8b9..d08e2e0edf 100644
--- a/src/dotnet-library/scala/runtime/RichException.scala
+++ b/src/dotnet-library/scala/runtime/RichException.scala
@@ -1,6 +1,6 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** / __/ __// _ | / / / _ | (c) 2002-2008, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
@@ -14,7 +14,7 @@ package scala.runtime
final class RichException(exc: System.Exception) {
- def printStackTrace() = System.Console.WriteLine(exc.StackTrace);
+ def printStackTrace() = System.Console.WriteLine(exc.StackTrace)
def getMessage() = exc.Message
def getStackTraceString: String = exc.StackTrace
diff --git a/src/dotnet-library/scala/runtime/RichInt.scala b/src/dotnet-library/scala/runtime/RichInt.scala
index 204e50fd2c..368a886df9 100644
--- a/src/dotnet-library/scala/runtime/RichInt.scala
+++ b/src/dotnet-library/scala/runtime/RichInt.scala
@@ -6,7 +6,7 @@
** |/ **
\* */
-// $Id: RichInt.scala 12529 2007-08-14 14:02:27Z michelou $
+// $Id$
package scala.runtime