Skip to content

Commit 54da006

Browse files
authored
Merge pull request #6763 from dotty-staging/remove-legacyapp
Remove dotty.runtime.LegacyApp
2 parents 3962d3c + 80d7bd5 commit 54da006

File tree

914 files changed

+916
-928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

914 files changed

+916
-928
lines changed

compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ private class ExtractAPICollector(implicit val ctx: Context) extends ThunkHolder
237237
api.ClassLikeDef.of(name, acc, modifiers, anns, tparams, defType)
238238
}
239239

240-
private[this] val LegacyAppClass = ctx.requiredClass("dotty.runtime.LegacyApp")
241-
242240
def apiClassStructure(csym: ClassSymbol): api.Structure = {
243241
val cinfo = csym.classInfo
244242

@@ -274,9 +272,7 @@ private class ExtractAPICollector(implicit val ctx: Context) extends ThunkHolder
274272
// TODO: We shouldn't have to compute inherited members. Instead, `Structure`
275273
// should have a lazy `parentStructures` field.
276274
val inherited = cinfo.baseClasses
277-
// We cannot filter out `LegacyApp` because it contains the main method,
278-
// see the comment about main class discovery in `computeType`.
279-
.filter(bc => !bc.is(Scala2x) || bc.eq(LegacyAppClass))
275+
.filter(bc => !bc.is(Scala2x))
280276
.flatMap(_.classInfo.decls.filter(s => !(s.is(Private) || declSet.contains(s))))
281277
// Inherited members need to be computed lazily because a class might contain
282278
// itself as an inherited member, like in `class A { class B extends A }`,

library/src/dotty/runtime/LegacyApp.scala

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
object B extends dotty.runtime.LegacyApp {
1+
object B extends App {
22
println(A.`=`)
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
object E extends dotty.runtime.LegacyApp {
1+
object E extends App {
22
assert(D.x == "3")
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
object C extends dotty.runtime.LegacyApp {
1+
object C extends App {
22
println(new B().foo(null))
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
object C extends dotty.runtime.LegacyApp {
1+
object C extends App {
22
println(new B().bar.x)
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
object C extends dotty.runtime.LegacyApp {
1+
object C extends App {
22
println(new B().bar("")("").x)
33
}

tests/disabled/existential/run/names-defaults.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import scala.language.{ higherKinds, existentials }
33

4-
object Test extends dotty.runtime.LegacyApp {
4+
object Test extends App {
55
def get[T](x: T) = { println("get: "+ x); x }
66

77
// TESTS
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
println(classOf[java.util.ArrayList[_]])
33
println(classOf[java.util.ArrayList[T] forSome { type T }])
44
}

tests/disabled/existential/run/t0528.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class RichStr extends Sequ[Char] {
99
def toArray: Array[Char] = Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
1010
}
1111

12-
object Test extends dotty.runtime.LegacyApp {
12+
object Test extends App {
1313
val x: RichStr = new RichStr
1414

1515
println((x: Sequ[Char]).toArray.deep) // calling through the bridge misses unboxing

tests/disabled/existential/run/t6443.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ object B extends A {
1212
def foo(d: String)(d2: d.type): D forSome { type D <: Derived; type S <: Derived } = {d2.isEmpty; null} // Bridge method required here!
1313
}
1414

15-
object Test extends dotty.runtime.LegacyApp {
15+
object Test extends App {
1616
B.bar
1717
}

tests/disabled/long-running/t6253a.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import scala.collection.immutable.HashSet
22

3-
object Test extends dotty.runtime.LegacyApp {
3+
object Test extends App {
44

55
var hashCount = 0
66

tests/disabled/long-running/t6253b.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import scala.collection.immutable.HashSet
22

3-
object Test extends dotty.runtime.LegacyApp {
3+
object Test extends App {
44

55
var hashCount = 0
66

tests/disabled/long-running/t6253c.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import scala.collection.immutable.HashSet
22

3-
object Test extends dotty.runtime.LegacyApp {
3+
object Test extends App {
44

55
var hashCount = 0
66

tests/disabled/macro/run/exprs_serialize.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.reflect.runtime.universe._
33
import scala.reflect.runtime.{universe => ru}
44
import scala.reflect.runtime.{currentMirror => cm}
55

6-
object Test extends dotty.runtime.LegacyApp {
6+
object Test extends App {
77
def test(expr: Expr[_]) =
88
try {
99
val fout = new ByteArrayOutputStream()

tests/disabled/macro/run/freetypes_false_alarm1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import scala.reflect.runtime.universe._
22
import scala.tools.reflect.Eval
33

4-
object Test extends dotty.runtime.LegacyApp {
4+
object Test extends App {
55
reify {
66
val ru = scala.reflect.runtime.universe
77
val tpe: ru.Type = ru.typeOf[List[Int]]

tests/disabled/macro/run/idempotency-case-classes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.reflect.runtime.{currentMirror => cm}
33
import scala.tools.reflect.{ToolBox, ToolBoxError}
44
import scala.tools.reflect.Eval
55

6-
object Test extends dotty.runtime.LegacyApp {
6+
object Test extends App {
77
val casee = reify {
88
case class C(x: Int, y: Int)
99
println(C(2, 3))

tests/disabled/macro/run/idempotency-extractors.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.reflect.runtime.{currentMirror => cm}
33
import scala.tools.reflect.{ToolBox, ToolBoxError}
44
import scala.tools.reflect.Eval
55

6-
object Test extends dotty.runtime.LegacyApp {
6+
object Test extends App {
77
object Extractor { def unapply(x: Int): Option[Int] = Some(x) }
88
val extractor = reify {
99
2 match { case Extractor(x) => x }

tests/disabled/macro/run/idempotency-labels.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.reflect.runtime.{currentMirror => cm}
33
import scala.tools.reflect.{ToolBox, ToolBoxError}
44
import scala.tools.reflect.Eval
55

6-
object Test extends dotty.runtime.LegacyApp {
6+
object Test extends App {
77
val label = reify {
88
var x = 0
99
while (x < 2) { x += 1 }

tests/disabled/macro/run/idempotency-lazy-vals.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.reflect.runtime.{currentMirror => cm}
33
import scala.tools.reflect.{ToolBox, ToolBoxError}
44
import scala.tools.reflect.Eval
55

6-
object Test extends dotty.runtime.LegacyApp {
6+
object Test extends App {
77
val lazee = reify {
88
class C {
99
lazy val x = 2

tests/disabled/macro/run/idempotency-this.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.reflect.runtime.{currentMirror => cm}
33
import scala.tools.reflect.{ToolBox, ToolBoxError}
44
import scala.tools.reflect.Eval
55

6-
object Test extends dotty.runtime.LegacyApp {
6+
object Test extends App {
77
val thiss = reify {
88
List[String]("")
99
}

tests/disabled/macro/run/macro-abort-fresh/Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
import scala.reflect.runtime.universe._
33
import scala.reflect.runtime.{currentMirror => cm}
44
import scala.tools.reflect.ToolBox
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
println(Macros.foo)
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
import Macros.Shmacros._
33
println(foo(2) + Macros.bar(2) * new Macros().quux(4))
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
import Macros.Shmacros._
33
println(foo(2) + Macros.bar(2) * new Macros().quux(4))
44
}

tests/disabled/macro/run/macro-basic-mamd-mi/Macros_Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Macros {
99
def quux(x: Int): Int = macro Impls.quux
1010
}
1111

12-
object Test extends dotty.runtime.LegacyApp {
12+
object Test extends App {
1313
import Macros.Shmacros._
1414
println(foo(2) + Macros.bar(2) * new Macros().quux(4))
1515
}

tests/disabled/macro/run/macro-blackbox-materialization/Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
println(implicitly[C[Int]])
33
println(implicitly[C[String]])
44
println(implicitly[C[Nothing]])

tests/disabled/macro/run/macro-bodyexpandstoimpl/Macros_Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ object Macros {
44
def foo(x: Int): Int = macro Impls.refToFoo(42)
55
}
66

7-
object Test extends dotty.runtime.LegacyApp {
7+
object Test extends App {
88
import Macros._
99
println(foo(42))
1010
}

tests/disabled/macro/run/macro-bundle-context-alias/Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
println(new C().blackbox)
33
println(new C().refinedBlackbox)
44
println(new C().whitebox)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
println(new C().blackbox)
33
println(new C().whitebox)
44
}

tests/disabled/macro/run/macro-bundle-static/Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
println(Macros.mono)
33
println(Macros.poly[Int])
44
println(new Enclosing.Impl(???).weird)

tests/disabled/macro/run/macro-bundle-toplevel/Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
println(Macros.mono)
33
println(Macros.poly[Int])
44
println(new Impl(???).weird)

tests/disabled/macro/run/macro-bundle-whitebox-decl/Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
println(Macros.mono)
33
println(Macros.poly[Int])
44
println(new Impl(???).weird)

tests/disabled/macro/run/macro-bundle-whitebox-use-raw/Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
println(ReturnTypeRefinement.foo.x)
33

44
case class Foo(i: Int, s: String, b: Boolean)

tests/disabled/macro/run/macro-bundle-whitebox-use-refined/Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
println(ReturnTypeRefinement.foo.x)
33

44
case class Foo(i: Int, s: String, b: Boolean)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
println("it works")
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
Macros.foo
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
println(implicitly[Complex[Foo]])
33
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import scala.concurrent._
22
import ExecutionContext.Implicits.global
33

4-
object Test extends dotty.runtime.LegacyApp {
4+
object Test extends App {
55
Macros.foo
66
}

tests/disabled/macro/run/macro-enclosingowner-detectvar/Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
val a1 = Macros.foo
33
val a2 = Predef.identity(Predef.identity(Macros.foo))
44
val a3: Int = Macros.foo

tests/disabled/macro/run/macro-enclosingowner-sbt/Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
val a1 = Macros.foo
33
val a2 = Predef.identity(Predef.identity(Macros.foo))
44
val a3: Int = Macros.foo

tests/disabled/macro/run/macro-enclosures/Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
test.Test.test
33
}
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
import Macros._
33
println(array(1, 2, 3).toList)
44
}

tests/disabled/macro/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
implicit val x = 42
33
def foo(implicit x: Int): Unit = macro Impls.foo
44
foo

tests/disabled/macro/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ object Macros {
33
implicit def foo(x: String): Option[Int] = macro Impls.foo
44
}
55

6-
object Test extends dotty.runtime.LegacyApp {
6+
object Test extends App {
77
import Macros._
88
println("2": Option[Int])
99
val s: Int = "2" getOrElse 0

tests/disabled/macro/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
implicit def foo: Int = macro Impls.foo
33
def bar(implicit x: Int) = println(x)
44
bar

tests/disabled/macro/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ object Macros {
55
implicit def foo(x: String): Option[Int] = macro Impls.foo
66
}
77

8-
object Test extends dotty.runtime.LegacyApp {
8+
object Test extends App {
99
import Macros._
1010
def bar[T <% Option[Int]](x: T) = println(x)
1111
println("2")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object Test extends dotty.runtime.LegacyApp {
1+
object Test extends App {
22
def foo(x: Int)(y: Int): Unit = macro Impls.foo
33
foo(40)(2)
44
}

tests/disabled/macro/run/macro-expand-nullary-generic/Macros_Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ object Macros {
55
def bar2[T](x: Int)(): Unit = macro Impls.barEmpty[T]
66
}
77

8-
object Test extends dotty.runtime.LegacyApp {
8+
object Test extends App {
99
Macros.foo1[Int]
1010
Macros.foo2[Int]
1111
Macros.foo2[Int]()

tests/disabled/macro/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ object Macros {
55
def bar2(x: Int)(): Unit = macro Impls.barEmpty
66
}
77

8-
object Test extends dotty.runtime.LegacyApp {
8+
object Test extends App {
99
Macros.foo1
1010
Macros.foo2
1111
Macros.foo2()

tests/disabled/macro/run/macro-expand-overload/Macros_Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Macros {
1010
def foo(x: Boolean): Unit = println("fooClassBoolean")
1111
}
1212

13-
object Test extends dotty.runtime.LegacyApp {
13+
object Test extends App {
1414
Macros.foo("42")
1515
Macros.foo(42)
1616
Macros.foo(true)

tests/disabled/macro/run/macro-expand-override/Macros_Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Z extends D {
1414
override def foo(x: Boolean): Unit = println("fooZBoolean")
1515
}
1616

17-
object Test extends dotty.runtime.LegacyApp {
17+
object Test extends App {
1818

1919
val dd: D = new D()
2020
dd.foo("42")

0 commit comments

Comments
 (0)