Skip to content

Commit 80d7bd5

Browse files
committed
Remove dotty.runtime.LegacyApp
scala.App has been working well enough for a long time now.
1 parent 8212f60 commit 80d7bd5

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

0 commit comments

Comments
 (0)