Renamed Application to App.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24321 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
1a37e1a8aa
commit
3678b968e3
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
val outer = new Outer
|
||||
new outer.Inner
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ class A(y: Int) {
|
|||
detach(bar)
|
||||
}
|
||||
|
||||
object test extends Application {
|
||||
object test extends App {
|
||||
val a = new A(1)
|
||||
println(a.bar(2))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
/** Test scala.Console functionality. */
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
|
||||
import Console._
|
||||
print(true)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ object ForceParse extends OuterTParams[AnyRef] {
|
|||
var field: InnerClass = null
|
||||
}
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
ForceParse
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
Test1
|
||||
Test2
|
||||
//Test3 // Java 1.5+ only
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// bug #1062
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
println((new MethVsField).three)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
/** found in nest.jar, compiled from nest.java */
|
||||
import nestpkg._;
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
val x = nest.best.rest.test
|
||||
Console.println(x.inc(1))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import enums._
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
def foo {
|
||||
val res: OuterEnum.Foo = OuterEnum.Foo.Bar
|
||||
println(res)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
import TypeRep._
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
testPrimitives
|
||||
testOptions
|
||||
testLists
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import scala.util.logging._
|
|||
import scala.xml._
|
||||
|
||||
|
||||
object Test extends Application with Assert {
|
||||
object Test extends App with Assert {
|
||||
val e: scala.xml.MetaData = Null //Node.NoAttributes
|
||||
val sc: scala.xml.NamespaceBinding = TopScope
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
object myBreak extends scala.xml.Unparsed("<br />")
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
val com = <!-- thissa comment -->
|
||||
val pi = <?this is a pi foo bar = && {{ ?>
|
||||
val crz = <![CDATA[
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object test extends Application {
|
||||
object test extends App {
|
||||
// more..
|
||||
type T = { def hello() }
|
||||
//val x4 = new AnyRef { def hello() { println("4") } } // ok!
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ class BImpl extends B {
|
|||
this: A =>
|
||||
}
|
||||
|
||||
object Test2 extends Application {
|
||||
object Test2 extends App {
|
||||
val b = new BImpl
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
// illegal
|
||||
val err1 = "" match { case Seq(f @ _*, ',') => f }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object ClassFormatErrorExample extends Application { new Aclass(1) }
|
||||
object ClassFormatErrorExample extends App { new Aclass(1) }
|
||||
|
||||
trait TBase { var p:Int = 0; def f(p1: Int) {} }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
object A extends Application {
|
||||
object A extends App {
|
||||
42 match { }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
class Truc {
|
||||
def getMachin() = "machin"
|
||||
def getMachinAsTruc() = this
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Main extends Application {
|
||||
object Main extends App {
|
||||
def f(a:Int=>Int):Int = a(4)
|
||||
def g:Int = f((x,y)=>x)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package test;
|
||||
|
||||
object Main extends Application {
|
||||
object Main extends App {
|
||||
class Global {
|
||||
case class Template(x : Int, y : Int) {
|
||||
Console.println("outer: " + Global.this);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
Console.println(List(List(1, 2, 3) : _*, List(4, 5, 6) : _*))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package test;
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
type Bar;
|
||||
trait FooImpl;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
val xs = List(4, 5, 6)
|
||||
val ys = List(1, 2, 3, xs: _*)
|
||||
def mkList1(x: Int) = List(x)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import scala.collection.mutable.HashMap
|
||||
|
||||
object AssertionError extends AnyRef with Application
|
||||
object AssertionError extends AnyRef with App
|
||||
{
|
||||
abstract class A {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object RegExpTest1 extends Application {
|
||||
object RegExpTest1 extends App {
|
||||
def co(x: Seq[Char]) = x match {
|
||||
case Seq('s','c','a','l','a', rest @ _*) =>
|
||||
val y: Seq[Int] = rest
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// An extractor with 2 results
|
||||
object Foo { def unapply(x : String) = Some(Pair(x, x)) }
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
|
||||
// Prints 'x'; ought not to compile (or maybe a should be the Pair?).
|
||||
"x" match { case Foo(a) => Console.println(a) }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
// #2235
|
||||
new A2235 with B2235
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
object deprNam2 {
|
||||
def f(@deprecatedName('s) x: String) = 1
|
||||
def f(s: Object) = 2
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
// TESTS
|
||||
|
||||
// re-ordering
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ class A {
|
|||
val x: A with D = null
|
||||
var y: x.T = new C("abc")
|
||||
}
|
||||
object Test extends A with Application {
|
||||
object Test extends A with App {
|
||||
class C { type T = Int; val x = 1 }
|
||||
type A = C
|
||||
y = 42
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@ trait Y extends X {
|
|||
n = "foo"
|
||||
}
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
new Y {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
def unreachable1(xs:Seq[Char]) = xs match {
|
||||
case Seq(x, y, _*) => x::y::Nil
|
||||
case Seq(x, y, z, w) => List(z,w) // redundant!
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application
|
||||
object Test extends App
|
||||
{
|
||||
abstract class Base {
|
||||
type T
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class FX2 extends P {
|
|||
override def a[T](t: T): List[T] = Nil
|
||||
}
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
val fx = new FX
|
||||
val p = new P
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
|
||||
def f(x: { type D; def m: D }): Null = null
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class A { def a = 0 }
|
||||
trait B extends A { println(super[A].a) }
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
new B {}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ trait PlusOne extends Value[Int] {
|
|||
override def value = super.value + 1
|
||||
}
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
object boom extends Value[java.lang.String]("foo") with PlusOne
|
||||
|
||||
println(boom.value) // class cast exception!
|
||||
|
|
|
|||
|
|
@ -3,4 +3,4 @@ class TestCase3() {
|
|||
def this( groups: (String, Int)*) = this()
|
||||
def this( groups: String*) = this()
|
||||
}
|
||||
object Main extends TestCase3 with Application
|
||||
object Main extends TestCase3 with App
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ class RichStr extends Sequ[Char] {
|
|||
def toArray: Array[Char] = new Array[Char](10)
|
||||
}
|
||||
|
||||
object Foo extends Application {
|
||||
object Foo extends App {
|
||||
val x: RichStr = new RichStr
|
||||
|
||||
println(x.toArray) // call directly
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
|
||||
class MacGuffin
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
object Foo extends Application{
|
||||
object Foo extends App{
|
||||
def `` = "fish"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
trait A
|
||||
trait B extends A
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import scala.collection.immutable._
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
val res0 = TreeSet(1, 2, 3)
|
||||
|
||||
//res0.map(x => x)(TreeSet.newBuilder[Int])
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ class A[-S](y : S) {
|
|||
val f = new { val x = y }
|
||||
}
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
val a = new A(1)
|
||||
val b = a : A[Nothing]
|
||||
b.f.x
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
class U {
|
||||
def f[T](x:T):T=x
|
||||
}
|
||||
object H extends Application {
|
||||
object H extends App {
|
||||
val u=new U
|
||||
val z:Int=(u.f _)(4)
|
||||
println("done")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
case class A(x: Int);
|
||||
|
||||
class Foo(a: A) { println("Foo created!"); def +(x: Int) = new A(this.a.x + x); }
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ class UnApp[P] {
|
|||
def unapply(a: P): Option[P] = Some(a)
|
||||
}
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
val b: UnApp[_] = new UnApp[String]
|
||||
val b(foo) = "foo"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ object Texts{
|
|||
}
|
||||
}
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
|
||||
implicit def array2list[T](array: Array[T]) = {
|
||||
println(array.toList.size)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Foo extends Application{
|
||||
object Foo extends App{
|
||||
'f' match {
|
||||
case 'o'|'c'|'b' => println("Oooo");
|
||||
case _ => println("stuff");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
trait A
|
||||
trait B extends A
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
trait A
|
||||
trait B extends A
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
|
||||
def foo(is:Int*) = 1;
|
||||
def foo(i:Int) = 2;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
val xs = Array(1, 2, 3)
|
||||
Console.println(xs.filter(_ >= 0).length)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
|
||||
def test() {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import scala.xml.{NodeSeq, Elem}
|
||||
|
||||
class EO extends Application with Moo{
|
||||
class EO extends App with Moo{
|
||||
def cat = <cat>dog</cat>
|
||||
|
||||
implicit def nodeSeqToFlog(in: Elem): Flog = new Flog(in)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@ class Directory(var dir_ : String)
|
|||
def dir = dir_
|
||||
}
|
||||
|
||||
object Test extends Directory("/bab/dkkd//dkkdkd//kdkdk") with Application {
|
||||
object Test extends Directory("/bab/dkkd//dkkdkd//kdkdk") with App {
|
||||
println(dir)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ class S[A](f: A => A, x: A) {
|
|||
}
|
||||
class T[B](f: B => B, y: B) extends S((x: B) => f(x), y) {
|
||||
}
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
new T[Int](x => x * 2, 1);
|
||||
val f = new S((x: Int) => x, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
|
||||
trait SpecialException {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
trait C[T] {
|
||||
def t: T
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ trait Lang2 extends Lang1 {
|
|||
class Eval2 extends Eval1 { self: Visitor => }
|
||||
}
|
||||
/*
|
||||
object Main with Application {
|
||||
object Main with App {
|
||||
val lang2 = new Lang2 {}
|
||||
val eval = new lang2.Eval2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
trait A;
|
||||
trait B;
|
||||
class Foo extends A with B { self: A with B => }
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
new Foo();
|
||||
Console.println("bug211 completed");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
def foo1(x: AnyRef) = x match { case x: Function0[_] => x() }
|
||||
def foo2(x: AnyRef) = x match { case x: Function0[Any] => x() }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// bug #2187
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
def foo(xs:List[String]) = xs match {
|
||||
case Seq(x) => x
|
||||
case Seq(x,y) => ""
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
class Bob[T]
|
||||
implicit def foo2bar[T](xs: List[T]): Bob[T] = new Bob[T]
|
||||
var x: Bob[Int] = null
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ trait B {
|
|||
private val foo: String = "B"
|
||||
def f = println(foo)
|
||||
}
|
||||
object Test extends Application with B with A {
|
||||
object Test extends App with B with A {
|
||||
println(foo) // prints "A", as expected
|
||||
f // prints "B", as expected
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ trait B {
|
|||
def f = println(foo)
|
||||
}
|
||||
trait A { val foo: String = "A" }
|
||||
object Test extends Application with B with A {
|
||||
object Test extends App with B with A {
|
||||
println(foo) // prints "A", as expected
|
||||
f // prints "B", as expected
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ trait Base {
|
|||
}
|
||||
}
|
||||
|
||||
object testBase extends Application with Base {
|
||||
object testBase extends App with Base {
|
||||
type exp = Exp
|
||||
val term = new Num(2);
|
||||
Console.println(term.eval)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Main extends Application {
|
||||
object Main extends App {
|
||||
|
||||
object Foo extends Enumeration(0, "Bar") { // 2
|
||||
val Bar = Value
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ trait Foo {
|
|||
case class Baz(r:bar) extends Bar;
|
||||
case object NoBar extends Bar;
|
||||
}
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
object ConcreteFooBar extends Foo { // if moved to toplevel, it works
|
||||
type bar = Bar;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ object tokens extends Enumeration {
|
|||
val NAME = Value("name");
|
||||
}
|
||||
|
||||
object test extends AnyRef with Application {
|
||||
object test extends AnyRef with App {
|
||||
import tokens._;
|
||||
|
||||
val reserved = new scala.collection.mutable.HashMap[String, Token]();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
def foo[T <% Ordered[T]](x: T){ Console.println(""+(x < x)+" "+(x <= x)) }
|
||||
def bar(x: Unit ): Unit = foo(x);
|
||||
def bar(x: Boolean): Unit = foo(x);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
object Truc {
|
||||
override def toString() = "oui"
|
||||
def toString(bool: Boolean) = "chaispas"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
import scala.reflect._;
|
||||
def titi = {
|
||||
var truc = 0
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
import scala.reflect._;
|
||||
def titi: Unit = {
|
||||
var truc = 0
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class Outer extends Application {
|
||||
class Outer extends App {
|
||||
val y: Int = 1
|
||||
abstract class C {
|
||||
val x: Int
|
||||
|
|
@ -11,7 +11,7 @@ class Outer extends Application {
|
|||
}
|
||||
}
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
val o = new Outer
|
||||
println(o.foo.x)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ trait T {
|
|||
}
|
||||
}
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
val t = new T{}
|
||||
val x = new t.X{}
|
||||
Console.println(x.foo)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ abstract class Foo
|
|||
abstract class Bar
|
||||
|
||||
object Test
|
||||
extends Foo with Application
|
||||
extends Foo with App
|
||||
{
|
||||
object x extends Bar
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ class Button extends Component {
|
|||
abstract class Origin {
|
||||
val delegate: Component }
|
||||
|
||||
object main extends Origin with Application {
|
||||
object main extends Origin with App {
|
||||
val delegate: Component {
|
||||
def sayHey: Unit
|
||||
} = new Button
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ object Conv {
|
|||
implicit def one2two (one: One): Two = new Two }
|
||||
class One extends Conv
|
||||
class Two
|
||||
object Test2 extends Application {
|
||||
object Test2 extends App {
|
||||
def fun (two: Two) = ()
|
||||
fun(new One)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ package foo {
|
|||
}
|
||||
|
||||
package bar {
|
||||
object Main extends Application {
|
||||
object Main extends App {
|
||||
foo.C.foo
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
|
||||
def f[A](x : => A) = x
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Ideally, an option in the bugtracking system would automatically
|
||||
* handle "pos" bugs.
|
||||
*/
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
|
||||
object Twice {
|
||||
def apply(x: Int) = x * 2
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package test;
|
||||
import scala.{Application => Main};
|
||||
import scala.{App => Main};
|
||||
class Test extends Main {
|
||||
import test.{Test => Hello}
|
||||
super[Application].main(Array("test"));
|
||||
super[App].main(Array("test"));
|
||||
private[Test] def xxx = 10;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ object Bang {
|
|||
}
|
||||
|
||||
*/
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
object IC extends Channel[Int]
|
||||
def f[b](x: ![b]): Int = x match {
|
||||
case send: ![c] =>
|
||||
|
|
@ -21,7 +21,7 @@ object Test extends Application {
|
|||
}
|
||||
}
|
||||
|
||||
object Test2 extends Application {
|
||||
object Test2 extends App {
|
||||
object IC extends Channel[Set[Int]]
|
||||
def f[b](s: ![b]): Set[Int] = s match {
|
||||
case IC ! x => x
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Comp extends Application {
|
||||
object Comp extends App {
|
||||
|
||||
trait Family {
|
||||
type T
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ object A {
|
|||
val s = "z is " + z;
|
||||
}
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
|
||||
Console.println(A.x);
|
||||
Console.println(A.y);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object ShapeTest extends Application {
|
||||
object ShapeTest extends App {
|
||||
|
||||
class Point(x: Int, y: Int) {
|
||||
override def toString() = "[" + x + "," + y + "]"
|
||||
|
|
|
|||
|
|
@ -82,18 +82,18 @@ object GUI {
|
|||
|
||||
object GUIClient {
|
||||
|
||||
class Application {
|
||||
class App {
|
||||
def quit() { Console.println("application exited") }
|
||||
}
|
||||
|
||||
class QuitButton (scr: Screen, p: Geom.Point, name: String, a: Application)
|
||||
class QuitButton (scr: Screen, p: Geom.Point, name: String, a: App)
|
||||
extends GUI.Button(scr, p, name) {
|
||||
def doit() { a.quit() }
|
||||
}
|
||||
|
||||
def main(args: Array[String]) {
|
||||
val b = new QuitButton(
|
||||
DummyScreen, Geom.Point(1, 1), "quit", new Application);
|
||||
DummyScreen, Geom.Point(1, 1), "quit", new App);
|
||||
b.draw();
|
||||
b.enable(true).mouseDown(Geom.Point(1, 2));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class Foo {
|
|||
}
|
||||
}
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
val foo = new Foo
|
||||
Console.println((new foo.Bar).id)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ class RichInt(n: Int) {
|
|||
def days = 1000*60*60*24*n
|
||||
}
|
||||
|
||||
object Test extends Application {
|
||||
object Test extends App {
|
||||
implicit def RichInt(n: Int): RichInt = new RichInt(n)
|
||||
println(10.days)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object test extends Application {
|
||||
object test extends App {
|
||||
// more..
|
||||
type T = { def hello() }
|
||||
//val x4 = new AnyRef { def hello() { println("4") } } // ok!
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object This extends Application {
|
||||
object This extends App {
|
||||
trait A {
|
||||
def foo(): Unit
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ package scala
|
|||
* <code>anonfun1</code>:
|
||||
* </p>
|
||||
* <pre>
|
||||
* <b>object</b> Main <b>extends</b> Application {
|
||||
* <b>object</b> Main <b>extends</b> App {
|
||||
*
|
||||
* <b>val</b> succ = (x: Int) => x + 1
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Main extends Application {
|
||||
object Main extends App {
|
||||
|
||||
val xs = 1 :: 2 :: 3 :: 4 :: 5 :: Nil
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ case class Cons[@specialized a](private val hd: a, tl: MyList[a]) extends MyList
|
|||
|
||||
abstract class IntList extends MyList[Int]
|
||||
|
||||
object Main extends Application {
|
||||
object Main extends App {
|
||||
val xs = 1 :: 2 :: 3 :: MyNil
|
||||
println(xs)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object SudokuSolver extends Application {
|
||||
object SudokuSolver extends App {
|
||||
// The board is represented by an array of strings (arrays of chars),
|
||||
// held in a global variable m. The program begins by reading 9 lines
|
||||
// of input to fill the board
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class Bar extends Foo {
|
|||
}
|
||||
}
|
||||
|
||||
object bug extends Application {
|
||||
object bug extends App {
|
||||
new Bar
|
||||
()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Reflection1 extends Application {
|
||||
object Reflection1 extends App {
|
||||
case class Element(name: String)
|
||||
println(reflect.Code.lift({val e = Element("someName"); e}).tree)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Test extends Application {
|
||||
object Test extends App {
|
||||
println(
|
||||
for(a <- Some(1);
|
||||
b <- Some(2);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object T1027 extends Application {
|
||||
object T1027 extends App {
|
||||
trait Comparable[T <: Comparable[T]] { this: T =>
|
||||
def < (that: T): Boolean
|
||||
def <=(that: T): Boolean = this < that || this == that
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
object Main extends Application {
|
||||
object Main extends App {
|
||||
|
||||
case class Foo (field : Option[String])
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue