compile.scala
来自「JAVA 语言的函数式编程扩展」· SCALA 代码 · 共 151 行
SCALA
151 行
//############################################################################// Compile Time Bugs & Test Cases//############################################################################// $Id: compile.scala 5359 2005-12-16 15:33:49Z dubochet $import java.lang.System; // to avoid name clash with .NET's library//############################################################################// Test 0/*class Test0Foo[X];object Test0Test { type Gen[A] = Test0Foo[A]; class Tic(g: Test0Test.Gen[Int]); class Tac(g: Gen[Int]);}//############################################################################// Test 1 - Single types in lambda liftobject Test1 { def main(args: Array[String]): Unit = { List[args.type](args); } def foo[X]: Any = { def bar(x: X) = List(x); 0 }}//############################################################################// Test 2 - Local variables owned by other local variablesclass Test2_1(i: Int) { val t = { val x = { val y = { val z = i; z; }; }; }; val x = { val y = { val z = i; z; }; }; val y = { val z = i; z; }; val z2_1 = i;}class Test2_2(i: Int) { { val t = { val x = { val y = { val z = i; z; }; }; }; val x = { val y = { val z = i; z; }; }; val y = { val z = i; z; }; val z2_2 = i; 0 }}class Test2_3() { def this(i: Int) = { this(); val t = { val x = { val y = { val z = i; z; }; }; }; val x = { val y = { val z = i; z; }; }; val y = { val z = i; z; }; val z2_3 = i; } def test(i: Int): Int = { val t = { val x = { val y = { val z = i; z; }; }; }; val x = { val y = { val z = i; z; }; }; val y = { val z = i; z; }; val z_test = i; 0 }}*///############################################################################// Test 3 - Super Calls with Mixinsclass Test3Foo;trait Test3A[T] { def fun: T = fun;}class Test3B extends Test3A[Test3Foo];trait Test3M extends Test3A[Test3Foo] { override def fun: Test3Foo = super.fun;}class Test3C extends Test3B with Test3M;//############################################################################
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?