Fixing more deprecation warnings.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@15756 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
f8fc7646e8
commit
ff86e95781
|
@ -1,4 +1,4 @@
|
||||||
bug1112.scala:12: error: wrong number of arguments for method call: (int)(=> () => unit)unit
|
bug1112.scala:12: error: wrong number of arguments for method call: (Int)(=> () => Unit)Unit
|
||||||
call(0,() => System.out.println("here we are"))
|
call(0,() => System.out.println("here we are"))
|
||||||
^
|
^
|
||||||
one error found
|
one error found
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
// (due to isFunctionType normalizing Type1 to a function type,
|
// (due to isFunctionType normalizing Type1 to a function type,
|
||||||
// but then the code that used that test not using the normalized type for further operations)
|
// but then the code that used that test not using the normalized type for further operations)
|
||||||
class Test {
|
class Test {
|
||||||
type Type1 = () => unit
|
type Type1 = () => Unit
|
||||||
|
|
||||||
def call(p: int)(f: => Type1) = {
|
def call(p: Int)(f: => Type1) = {
|
||||||
f()
|
f()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
case class Empty[a] extends IntMap[a];
|
case class Empty[a] extends IntMap[a];
|
||||||
case class Node[a](left: IntMap[a], keyVal: Pair[int, a], right: IntMap[a]) extends IntMap[a];
|
case class Node[a](left: IntMap[a], keyVal: Pair[Int, a], right: IntMap[a]) extends IntMap[a];
|
||||||
abstract class IntMap[a] {
|
abstract class IntMap[a] {
|
||||||
def lookup(key: int): a = this match {
|
def lookup(key: Int): a = this match {
|
||||||
case Empty =>
|
case Empty =>
|
||||||
error("clef inexistante")
|
error("clef inexistante")
|
||||||
case _ =>
|
case _ =>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
constrs.scala:6: error: type T is not a member of object test
|
constrs.scala:6: error: type T is not a member of object test
|
||||||
def this(y: int)(z: int)(t: this.T) = { this(this.u + y + z); Console.println(x) }
|
def this(y: Int)(z: Int)(t: this.T) = { this(this.u + y + z); Console.println(x) }
|
||||||
^
|
^
|
||||||
constrs.scala:6: error: value u is not a member of object test
|
constrs.scala:6: error: value u is not a member of object test
|
||||||
def this(y: int)(z: int)(t: this.T) = { this(this.u + y + z); Console.println(x) }
|
def this(y: Int)(z: Int)(t: this.T) = { this(this.u + y + z); Console.println(x) }
|
||||||
^
|
^
|
||||||
constrs.scala:10: error: called constructor's definition must precede calling constructor's definition
|
constrs.scala:10: error: called constructor's definition must precede calling constructor's definition
|
||||||
def this() = this("abc")
|
def this() = this("abc")
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
object test {
|
object test {
|
||||||
|
|
||||||
abstract class Test(x: int) {
|
abstract class Test(x: Int) {
|
||||||
type T;
|
type T;
|
||||||
val u = x;
|
val u = x;
|
||||||
def this(y: int)(z: int)(t: this.T) = { this(this.u + y + z); Console.println(x) }
|
def this(y: Int)(z: Int)(t: this.T) = { this(this.u + y + z); Console.println(x) }
|
||||||
}
|
}
|
||||||
|
|
||||||
class Foo(x: int) {
|
class Foo(x: Int) {
|
||||||
def this() = this("abc")
|
def this() = this("abc")
|
||||||
def this(x: String) = this(1)
|
def this(x: String) = this(1)
|
||||||
def this(x: boolean) = this(x)
|
def this(x: boolean) = this(x)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
faculty.scala:3: error: recursive method faculty needs result type
|
faculty.scala:3: error: recursive method faculty needs result type
|
||||||
def faculty(x: int) = if (x == 0) 1 else x * faculty(x - 1)
|
def faculty(x: Int) = if (x == 0) 1 else x * faculty(x - 1)
|
||||||
^
|
^
|
||||||
one error found
|
one error found
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
object Test {
|
object Test {
|
||||||
|
|
||||||
def faculty(x: int) = if (x == 0) 1 else x * faculty(x - 1)
|
def faculty(x: Int) = if (x == 0) 1 else x * faculty(x - 1)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
abstract class C {
|
abstract class C {
|
||||||
val f: int
|
val f: Int
|
||||||
}
|
}
|
||||||
|
|
||||||
object A extends C {
|
object A extends C {
|
||||||
|
|
|
@ -3,6 +3,6 @@ object Test {
|
||||||
case List(x) | List() => Console.println(x)
|
case List(x) | List() => Console.println(x)
|
||||||
}
|
}
|
||||||
List(2) match {
|
List(2) match {
|
||||||
case List(_: int) | List() => Console.println()
|
case List(_: Int) | List() => Console.println()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ trait Ordered[+a] {
|
||||||
* x == 0 iff this == that
|
* x == 0 iff this == that
|
||||||
* x > 0 iff this > that
|
* x > 0 iff this > that
|
||||||
*/
|
*/
|
||||||
def compareTo [b >: a <% Ordered[b]](that: b): int
|
def compareTo [b >: a <% Ordered[b]](that: b): Int
|
||||||
|
|
||||||
def < [b >: a <% Ordered[b]](that: b): boolean = (this compareTo that) < 0
|
def < [b >: a <% Ordered[b]](that: b): boolean = (this compareTo that) < 0
|
||||||
|
|
||||||
|
@ -25,13 +25,13 @@ trait Ordered[+a] {
|
||||||
object O {
|
object O {
|
||||||
|
|
||||||
implicit def view1(x: String): Ordered[String] = new Ordered[String] {
|
implicit def view1(x: String): Ordered[String] = new Ordered[String] {
|
||||||
def compareTo [b >: String <% Ordered[b]](y: b): int = y match {
|
def compareTo [b >: String <% Ordered[b]](y: b): Int = y match {
|
||||||
case y1: String => x compareTo y1
|
case y1: String => x compareTo y1
|
||||||
case _ => -(y compareTo x)
|
case _ => -(y compareTo x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
implicit def view2(x: char): Ordered[char] = new Ordered[char] {
|
implicit def view2(x: char): Ordered[char] = new Ordered[char] {
|
||||||
def compareTo [b >: char <% Ordered[b]](y: b): int = y match {
|
def compareTo [b >: char <% Ordered[b]](y: b): Int = y match {
|
||||||
case y1: char => x - y1
|
case y1: char => x - y1
|
||||||
case _ => -(y compareTo x)
|
case _ => -(y compareTo x)
|
||||||
}
|
}
|
||||||
|
@ -39,11 +39,11 @@ object O {
|
||||||
|
|
||||||
implicit def view3[a <% Ordered[a]](x: List[a]): Ordered[List[a]] =
|
implicit def view3[a <% Ordered[a]](x: List[a]): Ordered[List[a]] =
|
||||||
new Ordered[List[a]] {
|
new Ordered[List[a]] {
|
||||||
def compareTo [b >: List[a] <% Ordered[b]](y: b): int = y match {
|
def compareTo [b >: List[a] <% Ordered[b]](y: b): Int = y match {
|
||||||
case y1: List[a] => compareLists(x, y1)
|
case y1: List[a] => compareLists(x, y1)
|
||||||
case _ => -(y compareTo x)
|
case _ => -(y compareTo x)
|
||||||
}
|
}
|
||||||
private def compareLists(xs: List[a], ys: List[a]): int = {
|
private def compareLists(xs: List[a], ys: List[a]): Int = {
|
||||||
if (xs.isEmpty && ys.isEmpty) 0
|
if (xs.isEmpty && ys.isEmpty) 0
|
||||||
else if (xs.isEmpty) -1
|
else if (xs.isEmpty) -1
|
||||||
else if (ys.isEmpty) 1
|
else if (ys.isEmpty) 1
|
||||||
|
@ -77,7 +77,7 @@ class Node[a <% Ordered[a]](elem: a, l: Tree[a], r: Tree[a]) extends Tree[a] {
|
||||||
}
|
}
|
||||||
|
|
||||||
case class Str(elem: String) extends Ordered[Str] {
|
case class Str(elem: String) extends Ordered[Str] {
|
||||||
def compareTo[b >: Str <% Ordered[b]](that: b): int = that match {
|
def compareTo[b >: Str <% Ordered[b]](that: b): Int = that match {
|
||||||
case that1: Str => this.elem compareTo that1.elem
|
case that1: Str => this.elem compareTo that1.elem
|
||||||
case _ => -(that compareTo this)
|
case _ => -(that compareTo this)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,6 @@ def test() {
|
||||||
def myVal: T1 = value
|
def myVal: T1 = value
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.println(new B[int](23).myVal)
|
Console.println(new B[Int](23).myVal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class C[a] { def f: a = f; }
|
class C[a] { def f: a = f; }
|
||||||
class D[b] { class E extends C[b]; }
|
class D[b] { class E extends C[b]; }
|
||||||
object Test {
|
object Test {
|
||||||
val d = new D[int];
|
val d = new D[Int];
|
||||||
def e = new d.E;
|
def e = new d.E;
|
||||||
e.f;
|
e.f;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ object Test extends Application {
|
||||||
|
|
||||||
object Twice {
|
object Twice {
|
||||||
def apply(x: Int) = x * 2
|
def apply(x: Int) = x * 2
|
||||||
def unapply(x: Int): Option[Tuple1[int]] =
|
def unapply(x: Int): Option[Tuple1[Int]] =
|
||||||
if (x % 2 == 0) Some(Tuple1(x / 2))
|
if (x % 2 == 0) Some(Tuple1(x / 2))
|
||||||
else None
|
else None
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ trait HOSeq {
|
||||||
|
|
||||||
def map[K](f: T=>K): MapResult[K]
|
def map[K](f: T=>K): MapResult[K]
|
||||||
def filter(f: T=>Boolean): FilterResult
|
def filter(f: T=>Boolean): FilterResult
|
||||||
def subseq(from: int, to: int): Subseq
|
def subseq(from: Int, to: Int): Subseq
|
||||||
def flatMap[S <: Seq[K], K](f: T => S): S#Concat // legal?
|
def flatMap[S <: Seq[K], K](f: T => S): S#Concat // legal?
|
||||||
def concat(others: Seq[T]): Concat
|
def concat(others: Seq[T]): Concat
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,7 +6,7 @@ class Async {
|
||||||
|
|
||||||
class Buffer {
|
class Buffer {
|
||||||
val Put = new Async
|
val Put = new Async
|
||||||
//case class Put(x: int)
|
//case class Put(x: Int)
|
||||||
|
|
||||||
def joinPat(x: Any): Unit = {
|
def joinPat(x: Any): Unit = {
|
||||||
x match {
|
x match {
|
||||||
|
|
Loading…
Reference in New Issue