Skip to content

Commit 5be609f

Browse files
run srewrite version 88d3cd4126d135617a8189f0a855757d7e2ab806 on tests/untried/pos
1 parent 981a218 commit 5be609f

35 files changed

+118
-57
lines changed

tests/untried/pos/builders.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
object builders {
22

33
trait Builder[-From, +To, -Elem] {
4-
def += (elem: Elem)
4+
def += (elem: Elem): Unit
55
def result: To
66
}
77

8-
implicit def iterableBuilder[A, B] = new Builder[Iterable[A], Iterable[B], B] {
8+
implicit def iterableBuilder[A, B]: builders.Builder[Iterable[A],Iterable[B],B] = new Builder[Iterable[A], Iterable[B], B] {
99
println("new iterable builder")
1010
private val buf = new scala.collection.mutable.ListBuffer[B]
1111
def += (elem: B): Unit = { buf += elem }
1212
def result: Iterable[B] = buf.toList
1313
}
1414

15-
implicit def listBuilder[A, B] = new Builder[List[A], List[B], B] {
15+
implicit def listBuilder[A, B]: builders.Builder[List[A],List[B],B] = new Builder[List[A], List[B], B] {
1616
println("new list builder")
1717
private val buf = new scala.collection.mutable.ListBuffer[B]
1818
def += (elem: B): Unit = { buf += elem }

tests/untried/pos/exbound.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ class A[T <: A[T]] {
33
}
44

55
object Test {
6-
val x: A[X] forSome { type X } = null
6+
val x: A[_] = null
77
}

tests/untried/pos/generic-sigs.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ object A {
1111
def f6(x: Int) = new Bippy[t forSome { type t <: Int }]
1212
def f7(x: T forSome { type T <: Float }) = x
1313
def f8(x: T forSome { type T <: Unit }) = x
14-
def f9(x: T forSome { type T <: runtime.BoxedUnit }) = x
14+
def f9(x: T forSome { type T <: scala.runtime.BoxedUnit }) = x
1515
def f10(x: Int) = new Bippy[t forSome { type t <: Unit }]
1616
def f11(x: Int) = new Bippy[t forSome { type t >: Null }]
1717

tests/untried/pos/hk-infer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ object ShouldWorkHK {
2020
def underlying = xs
2121
def BOOP(ys: Seq[M[_]]) = new Booper(xs ++ ys)
2222
}
23-
implicit def mkBoop[M[_]](xs: Seq[M[_]]) = new Booper(xs)
23+
implicit def mkBoop[M[_]](xs: Seq[M[_]]): ShouldWorkHK.Booper[M] = new Booper(xs)
2424

2525
def f1 = x BOOP y BOOP x1 BOOP x2
2626
}
@@ -30,7 +30,7 @@ object DoesWorkHK {
3030
def underlying = xs
3131
def BOOP(ys: Seq[M[_]]) = new Booper[M](xs ++ ys)
3232
}
33-
implicit def mkBoop[M[_]](xs: Seq[M[_]]) = new Booper[M](xs)
33+
implicit def mkBoop[M[_]](xs: Seq[M[_]]): DoesWorkHK.Booper[M] = new Booper[M](xs)
3434

3535
def f1 = x BOOP y BOOP x1 BOOP x2
3636
}
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
abstract class NeedsXEarly {
22
val x: Int
33
}
4-
class Foo extends { val x = 1 } with NeedsXEarly
4+
class Foo extends NeedsXEarly {
5+
// TODO NEEDS MANUAL CHANGE (early initializers)
6+
// BEGIN copied early initializers
7+
val x = 1
8+
// END copied early initializers
9+
}

tests/untried/pos/overloaded_extractor_and_regular_def.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ trait TreesBase {
1212
}
1313

1414
trait TreesApi extends TreesBase {
15-
def Apply(x: String)
15+
def Apply(x: String): Unit
1616
}
1717

1818
class Universe extends TreesApi {

tests/untried/pos/pos-bug1241.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
object test extends App {
22
// more..
3-
type T = { def hello() }
3+
type T = { def hello(): Unit }
44
//val x4 = new AnyRef { def hello() { println("4") } } // ok!
55
val x4: T = new { def hello(): Unit = { println("4") } } // error!
66
x4.hello()

tests/untried/pos/presuperContext.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
class A {
2-
class C extends { val x: A = this } with AnyRef
2+
class C extends AnyRef {
3+
// TODO NEEDS MANUAL CHANGE (early initializers)
4+
// BEGIN copied early initializers
5+
val x: A = this
6+
// END copied early initializers
7+
}
38
}
49

510
class B(x: Int)

tests/untried/pos/spec-arrays.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
abstract class AbsArray[T] {
22
def apply(idx: Int): T
3-
def update(idx: Int, elem: T)
3+
def update(idx: Int, elem: T): Unit
44
def length: Int
55
def applyByte(idx: Int): Byte = apply(idx).asInstanceOf[Byte]
66
def updateByte(idx: Int, elem: Byte) = update(idx, elem.asInstanceOf[T])
@@ -44,7 +44,7 @@ class SpecArray[@specialized T](arr: Array[T]) extends AbsArray[T] {
4444

4545
abstract class Test {
4646
def sum(): Int
47-
def modify(i: Int)
47+
def modify(i: Int): Unit
4848
def run(): Unit = {
4949
var s = 0
5050
for (i <- 1 to 1000000) {

tests/untried/pos/t1614/foo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// foo.scala
22
trait Foo {
3-
def foo(arg: List[_])
3+
def foo(arg: List[_]): Unit
44
}
55
trait FooImpl extends Foo {
66
def foo(arg: List[_]): Unit = {}

tests/untried/pos/t3363-new.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ object TestCase {
77

88
//if fs was reduced to List (generic type with one parameter) then the code compiles
99
//if you inherit from MapOps[T] instead of MapOps[F] then code compiles fine
10-
implicit def map2ops[T,F](fs: Map[T,F]) = new MapOps[F] {
10+
implicit def map2ops[T,F](fs: Map[T,F]): TestCase.MapOps[F]{lazy val m: reflect.runtime.universe.TypeTag[T]; def is(xs: List[T]): List[List[T]]} = new MapOps[F] {
1111
//if you remove this line, then code compiles
1212
lazy val m: TypeTag[T] = sys.error("just something to make it compile")
1313
def is(xs: List[T]) = List(xs)

tests/untried/pos/t3363-old.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ object TestCase {
55

66
//if fs was reduced to List (generic type with one parameter) then the code compiles
77
//if you inherit from MapOps[T] instead of MapOps[F] then code compiles fine
8-
implicit def map2ops[T,F](fs: Map[T,F]) = new MapOps[F] {
8+
implicit def map2ops[T,F](fs: Map[T,F]): TestCase.MapOps[F]{lazy val m: Manifest[T]; def is(xs: List[T]): List[List[T]]} = new MapOps[F] {
99
//if you remove this line, then code compiles
1010
lazy val m: Manifest[T] = sys.error("just something to make it compile")
1111
def is(xs: List[T]) = List(xs)

tests/untried/pos/t3480.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
object Test {
22
val List(_*) = List(1)
3-
val Array( who, what @ _* ) = "Eclipse plugin cannot not handle this" split (" ")
3+
val Array( who, what : _* ) = "Eclipse plugin cannot not handle this" split (" ")
44
}

tests/untried/pos/t3577.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ case class C2(checks: Check[_]*);
44

55
object C {
66
def m(x : C2): Any = (null: Any) match {
7-
case C2(_, rest @ _*) => {
7+
case C2(_, rest : _*) => {
88
rest.map(_.value)
99
}
1010
}

tests/untried/pos/t3856.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ case class CS(xs: C[_]*)
44

55
// t3856
66
object Test {
7-
val x = CS(C(5), C("abc")) match { case CS(C(5), xs @ _*) => xs }
7+
val x = CS(C(5), C("abc")) match { case CS(C(5), xs : _*) => xs }
88
println(x)
99
}

0 commit comments

Comments
 (0)