diff options
Diffstat (limited to 'test/files')
380 files changed, 5103 insertions, 900 deletions
diff --git a/test/files/neg/macro-invalidimpl-a.check b/test/files/neg/macro-invalidimpl-a.check deleted file mode 100644 index 7f11f3b865..0000000000 --- a/test/files/neg/macro-invalidimpl-a.check +++ /dev/null @@ -1,4 +0,0 @@ -Macros_Test_2.scala:3: error: macro implementation must be in statically accessible object - def foo(x: Any) = macro impls.foo - ^ -one error found diff --git a/test/files/neg/macro-invalidimpl-a/Impls_1.scala b/test/files/neg/macro-invalidimpl-a/Impls_1.scala deleted file mode 100644 index cfa1218038..0000000000 --- a/test/files/neg/macro-invalidimpl-a/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -class Impls { - def foo(c: Ctx)(x: c.Expr[Any]) = ??? -} diff --git a/test/files/neg/macro-invalidimpl-a/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-a/Macros_Test_2.scala deleted file mode 100644 index 2220ddae0c..0000000000 --- a/test/files/neg/macro-invalidimpl-a/Macros_Test_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Macros { - val impls = new Impls - def foo(x: Any) = macro impls.foo -} - -object Test extends App { - import Macros._ - foo(42) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl-b.check b/test/files/neg/macro-invalidimpl-b.check deleted file mode 100644 index 7f11f3b865..0000000000 --- a/test/files/neg/macro-invalidimpl-b.check +++ /dev/null @@ -1,4 +0,0 @@ -Macros_Test_2.scala:3: error: macro implementation must be in statically accessible object - def foo(x: Any) = macro impls.foo - ^ -one error found diff --git a/test/files/neg/macro-invalidimpl-b/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-b/Macros_Test_2.scala deleted file mode 100644 index 81e40837d2..0000000000 --- a/test/files/neg/macro-invalidimpl-b/Macros_Test_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Macros { - val impls = Impls - def foo(x: Any) = macro impls.foo -} - -object Test extends App { - import Macros._ - foo(42) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl-c.check b/test/files/neg/macro-invalidimpl-c.check deleted file mode 100644 index 9e0181c0a3..0000000000 --- a/test/files/neg/macro-invalidimpl-c.check +++ /dev/null @@ -1,4 +0,0 @@ -Impls_Macros_1.scala:8: error: macro implementation must be in statically accessible object - def foo(x: Any) = macro Impls.foo - ^ -one error found diff --git a/test/files/neg/macro-invalidimpl-c/Impls_Macros_1.scala b/test/files/neg/macro-invalidimpl-c/Impls_Macros_1.scala deleted file mode 100644 index 67a0eb348b..0000000000 --- a/test/files/neg/macro-invalidimpl-c/Impls_Macros_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -class Macros { - object Impls { - def foo(c: Ctx)(x: c.Expr[Any]) = ??? - } - - def foo(x: Any) = macro Impls.foo -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl-d.check b/test/files/neg/macro-invalidimpl-d.check deleted file mode 100644 index 76a5ba9c8c..0000000000 --- a/test/files/neg/macro-invalidimpl-d.check +++ /dev/null @@ -1,4 +0,0 @@ -Macros_Test_2.scala:2: error: macro implementation must be in statically accessible object - def foo(x: Any) = macro Impls.foo - ^ -one error found diff --git a/test/files/neg/macro-invalidimpl-d/Impls_1.scala b/test/files/neg/macro-invalidimpl-d/Impls_1.scala deleted file mode 100644 index e0819c938c..0000000000 --- a/test/files/neg/macro-invalidimpl-d/Impls_1.scala +++ /dev/null @@ -1,7 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -trait MacroHelpers { - object Impls { - def foo(c: Ctx)(x: c.Expr[Any]) = x - } -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl-d/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-d/Macros_Test_2.scala deleted file mode 100644 index 067ab1ddec..0000000000 --- a/test/files/neg/macro-invalidimpl-d/Macros_Test_2.scala +++ /dev/null @@ -1,7 +0,0 @@ -class Macros extends MacroHelpers { - def foo(x: Any) = macro Impls.foo -} - -object Test extends App { - println(new Macros().foo(42)) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl-e.check b/test/files/neg/macro-invalidimpl-e.check deleted file mode 100644 index e0910b2899..0000000000 --- a/test/files/neg/macro-invalidimpl-e.check +++ /dev/null @@ -1,13 +0,0 @@ -Macros_Test_2.scala:2: error: ambiguous reference to overloaded definition, -both method foo in object Impls of type (c: scala.reflect.macros.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing -and method foo in object Impls of type (c: scala.reflect.macros.Context)(x: c.Expr[Any])Nothing -match expected type ? - def foo(x: Any) = macro Impls.foo - ^ -Macros_Test_2.scala:3: error: ambiguous reference to overloaded definition, -both method foo in object Impls of type (c: scala.reflect.macros.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing -and method foo in object Impls of type (c: scala.reflect.macros.Context)(x: c.Expr[Any])Nothing -match expected type ? - def foo(x: Any, y: Any) = macro Impls.foo - ^ -two errors found diff --git a/test/files/neg/macro-invalidimpl-e/Impls_1.scala b/test/files/neg/macro-invalidimpl-e/Impls_1.scala deleted file mode 100644 index fd40119c31..0000000000 --- a/test/files/neg/macro-invalidimpl-e/Impls_1.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo(c: Ctx)(x: c.Expr[Any]) = ??? - def foo(c: Ctx)(x: c.Expr[Any], y: c.Expr[Any]) = ??? -} diff --git a/test/files/neg/macro-invalidimpl-e/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-e/Macros_Test_2.scala deleted file mode 100644 index 6edde08167..0000000000 --- a/test/files/neg/macro-invalidimpl-e/Macros_Test_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Macros { - def foo(x: Any) = macro Impls.foo - def foo(x: Any, y: Any) = macro Impls.foo -} - -object Test extends App { - import Macros._ - foo(42) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl-f.check b/test/files/neg/macro-invalidimpl-f.check deleted file mode 100644 index 4e5851f566..0000000000 --- a/test/files/neg/macro-invalidimpl-f.check +++ /dev/null @@ -1,7 +0,0 @@ -Macros_Test_2.scala:2: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context)(): c.Expr[Unit] - found : (c: scala.reflect.macros.Context): c.Expr[Unit] -number of parameter sections differ - def bar1() = macro Impls.fooNullary - ^ -one error found diff --git a/test/files/neg/macro-invalidimpl-f/Impls_1.scala b/test/files/neg/macro-invalidimpl-f/Impls_1.scala deleted file mode 100644 index 0e4da86d22..0000000000 --- a/test/files/neg/macro-invalidimpl-f/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def fooNullary(c: Ctx) = { - import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works")))) - c.Expr[Unit](body) - } - - def fooEmpty(c: Ctx)() = fooNullary(c) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl-f/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-f/Macros_Test_2.scala deleted file mode 100644 index 493edf1df8..0000000000 --- a/test/files/neg/macro-invalidimpl-f/Macros_Test_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Macros { - def bar1() = macro Impls.fooNullary -} - -object Test extends App { - Macros.bar1 - Macros.bar1() - println("kkthxbai") -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl-g.check b/test/files/neg/macro-invalidimpl-g.check deleted file mode 100644 index 7342f7336f..0000000000 --- a/test/files/neg/macro-invalidimpl-g.check +++ /dev/null @@ -1,7 +0,0 @@ -Macros_Test_2.scala:2: error: macro implementation has wrong shape: - required: (c: scala.reflect.macros.Context): c.Expr[Unit] - found : (c: scala.reflect.macros.Context)(): c.Expr[Unit] -number of parameter sections differ - def foo1 = macro Impls.fooEmpty - ^ -one error found diff --git a/test/files/neg/macro-invalidimpl-g/Impls_1.scala b/test/files/neg/macro-invalidimpl-g/Impls_1.scala deleted file mode 100644 index 0e4da86d22..0000000000 --- a/test/files/neg/macro-invalidimpl-g/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def fooNullary(c: Ctx) = { - import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works")))) - c.Expr[Unit](body) - } - - def fooEmpty(c: Ctx)() = fooNullary(c) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl-g/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-g/Macros_Test_2.scala deleted file mode 100644 index 5561db9f9a..0000000000 --- a/test/files/neg/macro-invalidimpl-g/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo1 = macro Impls.fooEmpty -} - -object Test extends App { - Macros.foo1 - println("kkthxbai") -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl-h.check b/test/files/neg/macro-invalidimpl-h.check deleted file mode 100644 index ea76e1aeac..0000000000 --- a/test/files/neg/macro-invalidimpl-h.check +++ /dev/null @@ -1,4 +0,0 @@ -Macros_Test_2.scala:2: error: type arguments [String] do not conform to method foo's type parameter bounds [U <: Int] - def foo = macro Impls.foo[String] - ^ -one error found diff --git a/test/files/neg/macro-invalidimpl-h/Impls_1.scala b/test/files/neg/macro-invalidimpl-h/Impls_1.scala deleted file mode 100644 index 427fd3d5c0..0000000000 --- a/test/files/neg/macro-invalidimpl-h/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[U <: Int](c: Ctx) = ??? -} diff --git a/test/files/neg/macro-invalidimpl-i.check b/test/files/neg/macro-invalidimpl-i.check deleted file mode 100644 index 846ed8d134..0000000000 --- a/test/files/neg/macro-invalidimpl-i.check +++ /dev/null @@ -1,4 +0,0 @@ -Macros_Test_2.scala:4: error: macro implementation must be public - def foo = macro Impls.impl - ^ -one error found diff --git a/test/files/neg/macro-invalidimpl-i/Impls_1.scala b/test/files/neg/macro-invalidimpl-i/Impls_1.scala deleted file mode 100644 index c35d8ab3c1..0000000000 --- a/test/files/neg/macro-invalidimpl-i/Impls_1.scala +++ /dev/null @@ -1,7 +0,0 @@ -package foo - -import scala.reflect.macros.Context - -object Impls { - private[foo] def impl(c: Context) = ??? -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl-i/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl-i/Macros_Test_2.scala deleted file mode 100644 index fb129c70be..0000000000 --- a/test/files/neg/macro-invalidimpl-i/Macros_Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -package foo - -object Test extends App { - def foo = macro Impls.impl -} diff --git a/test/files/neg/macro-invalidimpl.check b/test/files/neg/macro-invalidimpl.check new file mode 100644 index 0000000000..aaf4f88fc2 --- /dev/null +++ b/test/files/neg/macro-invalidimpl.check @@ -0,0 +1,51 @@ +Macros_Test_2.scala:5: error: macro implementation reference has wrong shape. required: +macro [<static object>].<method name>[[<type args>]] or +macro [<macro bundle>].<method name>[[<type args>]] + def foo(x: Any) = macro impls.foo + ^ +Macros_Test_2.scala:10: error: macro implementation reference has wrong shape. required: +macro [<static object>].<method name>[[<type args>]] or +macro [<macro bundle>].<method name>[[<type args>]] + def foo(x: Any) = macro impls.foo + ^ +Macros_Test_2.scala:18: error: macro implementation reference has wrong shape. required: +macro [<static object>].<method name>[[<type args>]] or +macro [<macro bundle>].<method name>[[<type args>]] + def foo(x: Any) = macro Impls3.foo + ^ +Macros_Test_2.scala:22: error: macro implementation reference has wrong shape. required: +macro [<static object>].<method name>[[<type args>]] or +macro [<macro bundle>].<method name>[[<type args>]] + def foo(x: Any) = macro Impls4.foo + ^ +Macros_Test_2.scala:26: error: ambiguous reference to overloaded definition, +both method foo in object Impls5 of type (c: scala.reflect.macros.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing +and method foo in object Impls5 of type (c: scala.reflect.macros.Context)(x: c.Expr[Any])Nothing +match expected type ? + def foo(x: Any) = macro Impls5.foo + ^ +Macros_Test_2.scala:27: error: ambiguous reference to overloaded definition, +both method foo in object Impls5 of type (c: scala.reflect.macros.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing +and method foo in object Impls5 of type (c: scala.reflect.macros.Context)(x: c.Expr[Any])Nothing +match expected type ? + def foo(x: Any, y: Any) = macro Impls5.foo + ^ +Macros_Test_2.scala:31: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context): c.Expr[Unit] + found : (c: scala.reflect.macros.Context)(): c.Expr[Unit] +number of parameter sections differ + def foo1 = macro Impls6.fooEmpty + ^ +Macros_Test_2.scala:32: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context)(): c.Expr[Unit] + found : (c: scala.reflect.macros.Context): c.Expr[Unit] +number of parameter sections differ + def bar1() = macro Impls6.fooNullary + ^ +Macros_Test_2.scala:36: error: type arguments [String] do not conform to method foo's type parameter bounds [U <: Int] + def foo = macro Impls7.foo[String] + ^ +Macros_Test_2.scala:53: error: macro implementation must be public + def foo = macro Impls8.impl + ^ +10 errors found diff --git a/test/files/neg/macro-invalidimpl-a.flags b/test/files/neg/macro-invalidimpl.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidimpl-a.flags +++ b/test/files/neg/macro-invalidimpl.flags diff --git a/test/files/neg/macro-invalidimpl/Impls_1.scala b/test/files/neg/macro-invalidimpl/Impls_1.scala new file mode 100644 index 0000000000..cf78ecc65a --- /dev/null +++ b/test/files/neg/macro-invalidimpl/Impls_1.scala @@ -0,0 +1,40 @@ +import scala.reflect.macros.Context + +class Impls1 { + def foo(c: Context)(x: c.Expr[Any]) = ??? +} + +object Impls2 { + def foo(c: Context)(x: c.Expr[Any]) = ??? +} + +trait MacroHelpers { + object Impls4 { + def foo(c: Context)(x: c.Expr[Any]) = x + } +} + +object Impls5 { + def foo(c: Context)(x: c.Expr[Any]) = ??? + def foo(c: Context)(x: c.Expr[Any], y: c.Expr[Any]) = ??? +} + +object Impls6 { + def fooNullary(c: Context) = { + import c.universe._ + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works")))) + c.Expr[Unit](body) + } + + def fooEmpty(c: Context)() = fooNullary(c) +} + +object Impls7 { + def foo[U <: Int](c: Context) = ??? +} + +package foo { + object Impls8 { + private[foo] def impl(c: Context) = ??? + } +}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl/Macros_Test_2.scala new file mode 100644 index 0000000000..8aae9553f5 --- /dev/null +++ b/test/files/neg/macro-invalidimpl/Macros_Test_2.scala @@ -0,0 +1,55 @@ +import scala.reflect.macros.Context + +object Macros1 { + val impls = new Impls1 + def foo(x: Any) = macro impls.foo +} + +object Macros2 { + val impls = Impls2 + def foo(x: Any) = macro impls.foo +} + +class Macros3 { + object Impls3 { + def foo(c: Context)(x: c.Expr[Any]) = ??? + } + + def foo(x: Any) = macro Impls3.foo +} + +class Macros4 extends MacroHelpers { + def foo(x: Any) = macro Impls4.foo +} + +object Macros5 { + def foo(x: Any) = macro Impls5.foo + def foo(x: Any, y: Any) = macro Impls5.foo +} + +object Macros6 { + def foo1 = macro Impls6.fooEmpty + def bar1() = macro Impls6.fooNullary +} + +object Macros7 { + def foo = macro Impls7.foo[String] +} + +object Test extends App { + println(Macros1.foo(42)) + println(Macros2.foo(42)) + println(new Macros3().foo(42)) + println(new Macros4().foo(42)) + println(Macros5.foo(42)) + println(Macros6.foo1) + println(Macros6.bar1) + println(Macros6.bar1()) + println(Macros7.foo) +} + +package foo { + object Test extends App { + def foo = macro Impls8.impl + } +}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidret-nontree/Impls_1.scala b/test/files/neg/macro-invalidret-nontree/Impls_1.scala deleted file mode 100644 index ef19b1b405..0000000000 --- a/test/files/neg/macro-invalidret-nontree/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo(c: Ctx) = 2 -} diff --git a/test/files/neg/macro-invalidret-nontree/Macros_Test_2.scala b/test/files/neg/macro-invalidret-nontree/Macros_Test_2.scala deleted file mode 100644 index 96a8de2832..0000000000 --- a/test/files/neg/macro-invalidret-nontree/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo = macro Impls.foo -} - -object Test extends App { - import Macros._ - foo -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidret-nonuniversetree/Impls_1.scala b/test/files/neg/macro-invalidret-nonuniversetree/Impls_1.scala deleted file mode 100644 index f98376a2ba..0000000000 --- a/test/files/neg/macro-invalidret-nonuniversetree/Impls_1.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} -import scala.reflect.runtime.{universe => ru} - -object Impls { - def foo(c: Ctx) = ru.Literal(ru.Constant(42)) -} diff --git a/test/files/neg/macro-invalidret-nonuniversetree/Macros_Test_2.scala b/test/files/neg/macro-invalidret-nonuniversetree/Macros_Test_2.scala deleted file mode 100644 index 96a8de2832..0000000000 --- a/test/files/neg/macro-invalidret-nonuniversetree/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo = macro Impls.foo -} - -object Test extends App { - import Macros._ - foo -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidret.check b/test/files/neg/macro-invalidret.check new file mode 100644 index 0000000000..8c6ed4eb45 --- /dev/null +++ b/test/files/neg/macro-invalidret.check @@ -0,0 +1,13 @@ +Macros_Test_2.scala:2: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context): c.Expr[Any] + found : (c: scala.reflect.macros.Context): Int +type mismatch for return type: Int does not conform to c.Expr[Any] + def foo1 = macro Impls.foo1 + ^ +Macros_Test_2.scala:3: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context): c.Expr[Any] + found : (c: scala.reflect.macros.Context): reflect.runtime.universe.Literal +type mismatch for return type: reflect.runtime.universe.Literal does not conform to c.Expr[Any] + def foo2 = macro Impls.foo2 + ^ +two errors found diff --git a/test/files/neg/macro-invalidimpl-b.flags b/test/files/neg/macro-invalidret.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidimpl-b.flags +++ b/test/files/neg/macro-invalidret.flags diff --git a/test/files/neg/macro-invalidret/Impls_1.scala b/test/files/neg/macro-invalidret/Impls_1.scala new file mode 100644 index 0000000000..a58af1a23c --- /dev/null +++ b/test/files/neg/macro-invalidret/Impls_1.scala @@ -0,0 +1,7 @@ +import scala.reflect.macros.Context +import scala.reflect.runtime.{universe => ru} + +object Impls { + def foo1(c: Context) = 2 + def foo2(c: Context) = ru.Literal(ru.Constant(42)) +} diff --git a/test/files/neg/macro-invalidret/Macros_Test_2.scala b/test/files/neg/macro-invalidret/Macros_Test_2.scala new file mode 100644 index 0000000000..f8880fa023 --- /dev/null +++ b/test/files/neg/macro-invalidret/Macros_Test_2.scala @@ -0,0 +1,10 @@ +object Macros { + def foo1 = macro Impls.foo1 + def foo2 = macro Impls.foo2 +} + +object Test extends App { + import Macros._ + foo1 + foo2 +}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidshape-a.check b/test/files/neg/macro-invalidshape-a.check deleted file mode 100644 index f38a90819e..0000000000 --- a/test/files/neg/macro-invalidshape-a.check +++ /dev/null @@ -1,5 +0,0 @@ -Macros_Test_2.scala:2: error: macro body has wrong shape: - required: macro [<implementation object>].<method name>[[<type args>]] - def foo(x: Any) = macro 2 - ^ -one error found diff --git a/test/files/neg/macro-invalidshape-a/Impls_1.scala b/test/files/neg/macro-invalidshape-a/Impls_1.scala deleted file mode 100644 index 4467021545..0000000000 --- a/test/files/neg/macro-invalidshape-a/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo(c: Ctx)(x: c.Expr[Any]) = ??? -} diff --git a/test/files/neg/macro-invalidshape-a/Macros_Test_2.scala b/test/files/neg/macro-invalidshape-a/Macros_Test_2.scala deleted file mode 100644 index ffff17d1e7..0000000000 --- a/test/files/neg/macro-invalidshape-a/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo(x: Any) = macro 2 -} - -object Test extends App { - import Macros._ - foo(42) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidshape-b.check b/test/files/neg/macro-invalidshape-b.check deleted file mode 100644 index 976685c6bd..0000000000 --- a/test/files/neg/macro-invalidshape-b.check +++ /dev/null @@ -1,5 +0,0 @@ -Macros_Test_2.scala:2: error: macro body has wrong shape: - required: macro [<implementation object>].<method name>[[<type args>]] - def foo(x: Any) = macro Impls.foo(null)(null) - ^ -one error found diff --git a/test/files/neg/macro-invalidshape-b/Impls_1.scala b/test/files/neg/macro-invalidshape-b/Impls_1.scala deleted file mode 100644 index 4467021545..0000000000 --- a/test/files/neg/macro-invalidshape-b/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo(c: Ctx)(x: c.Expr[Any]) = ??? -} diff --git a/test/files/neg/macro-invalidshape-b/Macros_Test_2.scala b/test/files/neg/macro-invalidshape-b/Macros_Test_2.scala deleted file mode 100644 index b67cd32a6e..0000000000 --- a/test/files/neg/macro-invalidshape-b/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo(x: Any) = macro Impls.foo(null)(null) -} - -object Test extends App { - import Macros._ - foo(42) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidshape-c.check b/test/files/neg/macro-invalidshape-c.check deleted file mode 100644 index 0b2e9cfe4f..0000000000 --- a/test/files/neg/macro-invalidshape-c.check +++ /dev/null @@ -1,9 +0,0 @@ -Macros_Test_2.scala:2: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses - def foo(x: Any) = macro {2; Impls.foo} - ^ -Macros_Test_2.scala:2: error: missing arguments for method foo in object Impls; -follow this method with `_' if you want to treat it as a partially applied function - def foo(x: Any) = macro {2; Impls.foo} - ^ -one warning found -one error found diff --git a/test/files/neg/macro-invalidshape-c/Impls_1.scala b/test/files/neg/macro-invalidshape-c/Impls_1.scala deleted file mode 100644 index 4467021545..0000000000 --- a/test/files/neg/macro-invalidshape-c/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo(c: Ctx)(x: c.Expr[Any]) = ??? -} diff --git a/test/files/neg/macro-invalidshape-c/Macros_Test_2.scala b/test/files/neg/macro-invalidshape-c/Macros_Test_2.scala deleted file mode 100644 index 552c3710c7..0000000000 --- a/test/files/neg/macro-invalidshape-c/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo(x: Any) = macro {2; Impls.foo} -} - -object Test extends App { - import Macros._ - foo(42) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidshape-d.check b/test/files/neg/macro-invalidshape-d.check deleted file mode 100644 index e43a2ca0ab..0000000000 --- a/test/files/neg/macro-invalidshape-d.check +++ /dev/null @@ -1,8 +0,0 @@ -Macros_Test_2.scala:2: warning: macro is now a reserved word; usage as an identifier is deprecated - def foo(x: Any) = {2; macro Impls.foo} - ^ -Macros_Test_2.scala:2: error: ';' expected but '.' found. - def foo(x: Any) = {2; macro Impls.foo} - ^ -one warning found -one error found diff --git a/test/files/neg/macro-invalidshape-d.flags b/test/files/neg/macro-invalidshape-d.flags deleted file mode 100644 index 83b7265eb9..0000000000 --- a/test/files/neg/macro-invalidshape-d.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -language:experimental.macros diff --git a/test/files/neg/macro-invalidshape-d/Impls_1.scala b/test/files/neg/macro-invalidshape-d/Impls_1.scala deleted file mode 100644 index 4467021545..0000000000 --- a/test/files/neg/macro-invalidshape-d/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo(c: Ctx)(x: c.Expr[Any]) = ??? -} diff --git a/test/files/neg/macro-invalidshape-d/Macros_Test_2.scala b/test/files/neg/macro-invalidshape-d/Macros_Test_2.scala deleted file mode 100644 index bacd9a6e7c..0000000000 --- a/test/files/neg/macro-invalidshape-d/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo(x: Any) = {2; macro Impls.foo} -} - -object Test extends App { - import Macros._ - foo(42) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidshape.check b/test/files/neg/macro-invalidshape.check new file mode 100644 index 0000000000..1938f5ae47 --- /dev/null +++ b/test/files/neg/macro-invalidshape.check @@ -0,0 +1,20 @@ +Macros_Test_2.scala:2: error: macro implementation reference has wrong shape. required: +macro [<static object>].<method name>[[<type args>]] or +macro [<macro bundle>].<method name>[[<type args>]] + def foo1(x: Any) = macro 2 + ^ +Macros_Test_2.scala:3: error: macro implementation reference has wrong shape. required: +macro [<static object>].<method name>[[<type args>]] or +macro [<macro bundle>].<method name>[[<type args>]] + def foo2(x: Any) = macro Impls.foo(null)(null) + ^ +Macros_Test_2.scala:4: error: missing arguments for method foo in object Impls; +follow this method with `_' if you want to treat it as a partially applied function + def foo3(x: Any) = macro {2; Impls.foo} + ^ +Macros_Test_2.scala:7: error: macro implementation reference has wrong shape. required: +macro [<static object>].<method name>[[<type args>]] or +macro [<macro bundle>].<method name>[[<type args>]] + def foo = macro impl + ^ +four errors found diff --git a/test/files/neg/macro-invalidimpl-c.flags b/test/files/neg/macro-invalidshape.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidimpl-c.flags +++ b/test/files/neg/macro-invalidshape.flags diff --git a/test/files/neg/macro-invalidimpl-b/Impls_1.scala b/test/files/neg/macro-invalidshape/Impls_1.scala index 4467021545..4467021545 100644 --- a/test/files/neg/macro-invalidimpl-b/Impls_1.scala +++ b/test/files/neg/macro-invalidshape/Impls_1.scala diff --git a/test/files/neg/macro-invalidshape/Macros_Test_2.scala b/test/files/neg/macro-invalidshape/Macros_Test_2.scala new file mode 100644 index 0000000000..cf37e14d8e --- /dev/null +++ b/test/files/neg/macro-invalidshape/Macros_Test_2.scala @@ -0,0 +1,17 @@ +object Macros { + def foo1(x: Any) = macro 2 + def foo2(x: Any) = macro Impls.foo(null)(null) + def foo3(x: Any) = macro {2; Impls.foo} + { + def impl(c: scala.reflect.macros.Context) = c.literalUnit + def foo = macro impl + foo + } +} + +object Test extends App { + import Macros._ + foo1(42) + foo2(42) + foo3(42) +}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-context-bounds/Impls_1.scala b/test/files/neg/macro-invalidsig-context-bounds/Impls_1.scala deleted file mode 100644 index c066c485b1..0000000000 --- a/test/files/neg/macro-invalidsig-context-bounds/Impls_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[U: c.WeakTypeTag: Numeric](c: Ctx) = { - import c.universe._ - Literal(Constant(42)) - } -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-context-bounds/Macros_Test_1.scala b/test/files/neg/macro-invalidsig-context-bounds/Macros_Test_1.scala deleted file mode 100644 index 5b4602f328..0000000000 --- a/test/files/neg/macro-invalidsig-context-bounds/Macros_Test_1.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo[U] = macro Impls.foo[U] -} - -object Test extends App { - import Macros._ - println(foo[String]) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-ctx-badargc/Impls_1.scala b/test/files/neg/macro-invalidsig-ctx-badargc/Impls_1.scala deleted file mode 100644 index 4d5d29158f..0000000000 --- a/test/files/neg/macro-invalidsig-ctx-badargc/Impls_1.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Impls { - def foo = ??? -} diff --git a/test/files/neg/macro-invalidsig-ctx-badargc/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-ctx-badargc/Macros_Test_2.scala deleted file mode 100644 index 96a8de2832..0000000000 --- a/test/files/neg/macro-invalidsig-ctx-badargc/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo = macro Impls.foo -} - -object Test extends App { - import Macros._ - foo -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-ctx-badtype/Impls_1.scala b/test/files/neg/macro-invalidsig-ctx-badtype/Impls_1.scala deleted file mode 100644 index cf1a4cf85c..0000000000 --- a/test/files/neg/macro-invalidsig-ctx-badtype/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.api.{Universe => Ctx} - -object Impls { - def foo(c: Ctx) = ??? -} diff --git a/test/files/neg/macro-invalidsig-ctx-badtype/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-ctx-badtype/Macros_Test_2.scala deleted file mode 100644 index 96a8de2832..0000000000 --- a/test/files/neg/macro-invalidsig-ctx-badtype/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo = macro Impls.foo -} - -object Test extends App { - import Macros._ - foo -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-ctx-badvarargs/Impls_1.scala b/test/files/neg/macro-invalidsig-ctx-badvarargs/Impls_1.scala deleted file mode 100644 index c4ed8be91e..0000000000 --- a/test/files/neg/macro-invalidsig-ctx-badvarargs/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo(cs: Ctx*) = ??? -} diff --git a/test/files/neg/macro-invalidsig-ctx-badvarargs/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-ctx-badvarargs/Macros_Test_2.scala deleted file mode 100644 index 96a8de2832..0000000000 --- a/test/files/neg/macro-invalidsig-ctx-badvarargs/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo = macro Impls.foo -} - -object Test extends App { - import Macros._ - foo -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-ctx-noctx/Impls_1.scala b/test/files/neg/macro-invalidsig-ctx-noctx/Impls_1.scala deleted file mode 100644 index 6904cfb1dc..0000000000 --- a/test/files/neg/macro-invalidsig-ctx-noctx/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo(c: Ctx) = ??? -} diff --git a/test/files/neg/macro-invalidsig-ctx-noctx/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-ctx-noctx/Macros_Test_2.scala deleted file mode 100644 index e053cf99df..0000000000 --- a/test/files/neg/macro-invalidsig-ctx-noctx/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo(x: Any) = macro Impls.foo -} - -object Test extends App { - import Macros._ - foo(42) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala deleted file mode 100644 index 8205694768..0000000000 --- a/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo_targs[T, U: c.WeakTypeTag](c: Ctx)(implicit x: c.Expr[Int]) = { - import c.{prefix => prefix} - import c.universe._ - val body = Block(List( - Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("invoking foo_targs...")))), - Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("type of prefix is: " + prefix.staticType)))), - Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("U is: " + implicitly[c.WeakTypeTag[U]].tpe))))), - Literal(Constant(()))) - c.Expr[Unit](body) - } -} - -class Macros[T] { - def foo_targs[U](x: Int) = macro Impls.foo_targs[T, U] -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-implicit-params/Test_2.scala b/test/files/neg/macro-invalidsig-implicit-params/Test_2.scala deleted file mode 100644 index 90e850df21..0000000000 --- a/test/files/neg/macro-invalidsig-implicit-params/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - println("foo_targs:") - new Macros[Int]().foo_targs[String](42) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-params-badargc/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-badargc/Impls_Macros_1.scala deleted file mode 100644 index ae16612b93..0000000000 --- a/test/files/neg/macro-invalidsig-params-badargc/Impls_Macros_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = ??? -} - -object Macros { - def foo(x: Int) = macro Impls.foo -} diff --git a/test/files/neg/macro-invalidsig-params-badargc/Test_2.scala b/test/files/neg/macro-invalidsig-params-badargc/Test_2.scala deleted file mode 100644 index cbd6232073..0000000000 --- a/test/files/neg/macro-invalidsig-params-badargc/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - import Macros._ - foo(42) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-params-badtype.check b/test/files/neg/macro-invalidsig-params-badtype.check index 3ec40d7e5b..3cc1c9abf1 100644 --- a/test/files/neg/macro-invalidsig-params-badtype.check +++ b/test/files/neg/macro-invalidsig-params-badtype.check @@ -1,7 +1,7 @@ Impls_Macros_1.scala:8: error: macro implementation has wrong shape: required: (c: scala.reflect.macros.Context)(x: c.Expr[Int]): c.Expr[Any] - found : (c: scala.reflect.macros.Context)(x: c.universe.Tree): Nothing -type mismatch for parameter x: c.Expr[Int] does not conform to c.universe.Tree + found : (c: scala.reflect.macros.Context)(x: Int): Nothing +type mismatch for parameter x: c.Expr[Int] does not conform to Int def foo(x: Int) = macro Impls.foo - ^ + ^ one error found diff --git a/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala index ab90b85881..175683d6d3 100644 --- a/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala +++ b/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala @@ -1,7 +1,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { - def foo(c: Ctx)(x: c.universe.Tree) = ??? + def foo(c: Ctx)(x: Int) = ??? } object Macros { diff --git a/test/files/neg/macro-invalidsig-params-badtype/Test_2.scala b/test/files/neg/macro-invalidsig-params-badtype/Test_2.scala deleted file mode 100644 index cbd6232073..0000000000 --- a/test/files/neg/macro-invalidsig-params-badtype/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - import Macros._ - foo(42) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-params-badvarargs/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-badvarargs/Impls_Macros_1.scala deleted file mode 100644 index b4c75ad0ba..0000000000 --- a/test/files/neg/macro-invalidsig-params-badvarargs/Impls_Macros_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo(c: Ctx)(xs: c.Expr[Int]*) = ??? -} - -object Macros { - def foo(x: Int, y: Int) = macro Impls.foo -} diff --git a/test/files/neg/macro-invalidsig-params-badvarargs/Test_2.scala b/test/files/neg/macro-invalidsig-params-badvarargs/Test_2.scala deleted file mode 100644 index fa50ac4f73..0000000000 --- a/test/files/neg/macro-invalidsig-params-badvarargs/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - import Macros._ - foo(42, 100) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-params-namemismatch/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-namemismatch/Impls_Macros_1.scala deleted file mode 100644 index c7cf0b06c4..0000000000 --- a/test/files/neg/macro-invalidsig-params-namemismatch/Impls_Macros_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo(c: Ctx)(y: c.Expr[Int], x: c.Expr[Int]) = ??? -} - -object Macros { - def foo(x: Int, y: Int) = macro Impls.foo -} diff --git a/test/files/neg/macro-invalidsig-params-namemismatch/Test_2.scala b/test/files/neg/macro-invalidsig-params-namemismatch/Test_2.scala deleted file mode 100644 index fa50ac4f73..0000000000 --- a/test/files/neg/macro-invalidsig-params-namemismatch/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - import Macros._ - foo(42, 100) -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-tparams-badtype/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-badtype/Impls_1.scala deleted file mode 100644 index dbeca178a7..0000000000 --- a/test/files/neg/macro-invalidsig-tparams-badtype/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[U](c: Ctx)(U: c.universe.Type) = ??? -} diff --git a/test/files/neg/macro-invalidsig-tparams-badtype/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-tparams-badtype/Macros_Test_2.scala deleted file mode 100644 index a82e813221..0000000000 --- a/test/files/neg/macro-invalidsig-tparams-badtype/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo[U] = macro Impls.foo[U] -} - -object Test extends App { - import Macros._ - foo[Int] -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-a/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-bounds-a/Impls_1.scala deleted file mode 100644 index 89020de7dd..0000000000 --- a/test/files/neg/macro-invalidsig-tparams-bounds-a/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[U <: String](c: Ctx) = ??? -} diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-a/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-tparams-bounds-a/Macros_Test_2.scala deleted file mode 100644 index a82e813221..0000000000 --- a/test/files/neg/macro-invalidsig-tparams-bounds-a/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo[U] = macro Impls.foo[U] -} - -object Test extends App { - import Macros._ - foo[Int] -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-b/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-bounds-b/Impls_1.scala deleted file mode 100644 index 89020de7dd..0000000000 --- a/test/files/neg/macro-invalidsig-tparams-bounds-b/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[U <: String](c: Ctx) = ??? -} diff --git a/test/files/neg/macro-invalidsig-tparams-bounds-b/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-tparams-bounds-b/Macros_Test_2.scala deleted file mode 100644 index eed6369a16..0000000000 --- a/test/files/neg/macro-invalidsig-tparams-bounds-b/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo[U <: Int] = macro Impls.foo[U] -} - -object Test extends App { - import Macros._ - foo[Int] -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-a/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-notparams-a/Impls_1.scala deleted file mode 100644 index f8b3c92869..0000000000 --- a/test/files/neg/macro-invalidsig-tparams-notparams-a/Impls_1.scala +++ /dev/null @@ -1,6 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[U: c.WeakTypeTag](c: Ctx) = ??? -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-a/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-tparams-notparams-a/Macros_Test_2.scala deleted file mode 100644 index 96a8de2832..0000000000 --- a/test/files/neg/macro-invalidsig-tparams-notparams-a/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo = macro Impls.foo -} - -object Test extends App { - import Macros._ - foo -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-b/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-notparams-b/Impls_1.scala deleted file mode 100644 index baf3aab9e3..0000000000 --- a/test/files/neg/macro-invalidsig-tparams-notparams-b/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[T: c.WeakTypeTag, U: c.WeakTypeTag, V](c: Ctx)(implicit V: c.WeakTypeTag[V]): c.Expr[Unit] = { - println(implicitly[c.WeakTypeTag[T]]) - println(implicitly[c.WeakTypeTag[U]]) - println(V) - c.literalUnit - } -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-b/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-tparams-notparams-b/Macros_Test_2.scala deleted file mode 100644 index 7d02bf613a..0000000000 --- a/test/files/neg/macro-invalidsig-tparams-notparams-b/Macros_Test_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -class D[T] { - class C[U] { - def foo[V] = macro Impls.foo - } -} - -object Test extends App { - val outer1 = new D[Int] - val outer2 = new outer1.C[String] - outer2.foo[Boolean] -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-c/Impls_1.scala b/test/files/neg/macro-invalidsig-tparams-notparams-c/Impls_1.scala deleted file mode 100644 index 44b4ed6ab3..0000000000 --- a/test/files/neg/macro-invalidsig-tparams-notparams-c/Impls_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[T: c.WeakTypeTag, U: c.WeakTypeTag, V](c: Ctx)(implicit V: c.WeakTypeTag[V]): c.Expr[Unit] = { - import c.universe._ - println(implicitly[c.WeakTypeTag[T]]) - println(implicitly[c.WeakTypeTag[U]]) - println(V) - c.literalUnit - } -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-tparams-notparams-c/Macros_Test_2.scala b/test/files/neg/macro-invalidsig-tparams-notparams-c/Macros_Test_2.scala deleted file mode 100644 index 109e142e52..0000000000 --- a/test/files/neg/macro-invalidsig-tparams-notparams-c/Macros_Test_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -class D[T] { - class C[U] { - def foo[V] = macro Impls.foo[V] - } -} - -object Test extends App { - val outer1 = new D[Int] - val outer2 = new outer1.C[String] - outer2.foo[Boolean] -}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig.check b/test/files/neg/macro-invalidsig.check new file mode 100644 index 0000000000..cbdaf51081 --- /dev/null +++ b/test/files/neg/macro-invalidsig.check @@ -0,0 +1,82 @@ +Macros_Test_2.scala:2: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context): c.Expr[Any] + found : (c: scala.reflect.macros.Context)(implicit evidence$2: Numeric[U]): c.universe.Literal +macro implementations cannot have implicit parameters other than WeakTypeTag evidences + def foo[U] = macro Impls1.foo[U] + ^ +Macros_Test_2.scala:6: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context): c.Expr[Any] + found : : Nothing +number of parameter sections differ + def foo = macro Impls2.foo + ^ +Macros_Test_2.scala:10: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context): c.Expr[Any] + found : (c: scala.reflect.api.Universe): Nothing +type mismatch for parameter c: scala.reflect.macros.Context does not conform to scala.reflect.api.Universe + def foo = macro Impls3.foo + ^ +Macros_Test_2.scala:14: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context): c.Expr[Any] + found : (cs: scala.reflect.macros.Context*): Nothing +types incompatible for parameter cs: corresponding is not a vararg parameter + def foo = macro Impls4.foo + ^ +Macros_Test_2.scala:18: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context)(x: c.Expr[Any]): c.Expr[Any] + found : (c: scala.reflect.macros.Context): Nothing +number of parameter sections differ + def foo(x: Any) = macro Impls5.foo + ^ +Macros_Test_2.scala:22: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context)(x: c.Expr[Int]): c.Expr[Unit] + found : (c: scala.reflect.macros.Context)(implicit x: c.Expr[Int]): c.Expr[Unit] +macro implementations cannot have implicit parameters other than WeakTypeTag evidences + def foo[U](x: Int) = macro Impls6.foo[T, U] + ^ +Macros_Test_2.scala:26: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context)(x: c.Expr[Int]): c.Expr[Any] + found : (c: scala.reflect.macros.Context)(x: c.Expr[Int], y: c.Expr[Int]): Nothing +parameter lists have different length, found extra parameter y: c.Expr[Int] + def foo(x: Int) = macro Impls7.foo + ^ +Macros_Test_2.scala:30: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context)(x: c.Expr[Int]): c.Expr[Any] + found : (c: scala.reflect.macros.Context)(x: c.universe.Symbol): Nothing +type mismatch for parameter x: c.Expr[Int] does not conform to c.universe.Symbol + def foo(x: Int) = macro Impls8.foo + ^ +Macros_Test_2.scala:34: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any] + found : (c: scala.reflect.macros.Context)(xs: c.Expr[Int]*): Nothing +parameter lists have different length, required extra parameter y: c.Expr[Int] + def foo(x: Int, y: Int) = macro Impls9.foo + ^ +Macros_Test_2.scala:38: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Any] + found : (c: scala.reflect.macros.Context)(y: c.Expr[Int], x: c.Expr[Int]): Nothing +parameter names differ: x != y + def foo(x: Int, y: Int) = macro Impls10.foo + ^ +Macros_Test_2.scala:42: error: macro implementation has wrong shape: + required: (c: scala.reflect.macros.Context): c.Expr[Any] + found : (c: scala.reflect.macros.Context)(U: c.universe.Type): Nothing +number of parameter sections differ + def foo[U] = macro Impls11.foo[U] + ^ +Macros_Test_2.scala:46: error: type arguments [U] do not conform to method foo's type parameter bounds [U <: String] + def foo[U] = macro Impls12.foo[U] + ^ +Macros_Test_2.scala:50: error: type arguments [U] do not conform to method foo's type parameter bounds [U <: String] + def foo[U <: Int] = macro Impls13.foo[U] + ^ +Macros_Test_2.scala:54: error: wrong number of type parameters for method foo: [U](c: scala.reflect.macros.Context)(implicit evidence$4: c.WeakTypeTag[U])Nothing + def foo = macro Impls14.foo + ^ +Macros_Test_2.scala:59: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.macros.Context)(implicit evidence$5: c.WeakTypeTag[T], implicit evidence$6: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit] + def foo15[V] = macro Impls15.foo + ^ +Macros_Test_2.scala:60: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.macros.Context)(implicit evidence$7: c.WeakTypeTag[T], implicit evidence$8: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit] + def foo16[V] = macro Impls16.foo[V] + ^ +16 errors found diff --git a/test/files/neg/macro-invalidimpl-d.flags b/test/files/neg/macro-invalidsig.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidimpl-d.flags +++ b/test/files/neg/macro-invalidsig.flags diff --git a/test/files/neg/macro-invalidsig/Impls_1.scala b/test/files/neg/macro-invalidsig/Impls_1.scala new file mode 100644 index 0000000000..e7d6c18f8d --- /dev/null +++ b/test/files/neg/macro-invalidsig/Impls_1.scala @@ -0,0 +1,88 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.Context + +object Impls1 { + def foo[U: c.WeakTypeTag: Numeric](c: Context) = { + import c.universe._ + Literal(Constant(42)) + } +} + +object Impls2 { + def foo = ??? +} + +object Impls3 { + def foo(c: scala.reflect.api.Universe) = ??? +} + +object Impls4 { + def foo(cs: Context*) = ??? +} + +object Impls5 { + def foo(c: Context) = ??? +} + +object Impls6 { + def foo[T, U: c.WeakTypeTag](c: Context)(implicit x: c.Expr[Int]) = { + import c.{prefix => prefix} + import c.universe._ + val body = Block(List( + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("invoking foo_targs...")))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("type of prefix is: " + prefix.staticType)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("U is: " + implicitly[c.WeakTypeTag[U]].tpe))))), + Literal(Constant(()))) + c.Expr[Unit](body) + } +} + +object Impls7 { + def foo(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = ??? +} + +object Impls8 { + def foo(c: Context)(x: c.universe.Symbol) = ??? +} + +object Impls9 { + def foo(c: Context)(xs: c.Expr[Int]*) = ??? +} + +object Impls10 { + def foo(c: Context)(y: c.Expr[Int], x: c.Expr[Int]) = ??? +} + +object Impls11 { + def foo[U](c: Context)(U: c.universe.Type) = ??? +} + +object Impls12 { + def foo[U <: String](c: Context) = ??? +} + +object Impls13 { + def foo[U <: String](c: Context) = ??? +} + +object Impls14 { + def foo[U: c.WeakTypeTag](c: Context) = ??? +} + +object Impls15 { + def foo[T: c.WeakTypeTag, U: c.WeakTypeTag, V](c: Context)(implicit V: c.WeakTypeTag[V]): c.Expr[Unit] = { + println(implicitly[c.WeakTypeTag[T]]) + println(implicitly[c.WeakTypeTag[U]]) + println(V) + c.literalUnit + } +} + +object Impls16 { + def foo[T: c.WeakTypeTag, U: c.WeakTypeTag, V](c: Context)(implicit V: c.WeakTypeTag[V]): c.Expr[Unit] = { + println(implicitly[c.WeakTypeTag[T]]) + println(implicitly[c.WeakTypeTag[U]]) + println(V) + c.literalUnit + } +}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidsig/Macros_Test_2.scala b/test/files/neg/macro-invalidsig/Macros_Test_2.scala new file mode 100644 index 0000000000..0a6a321431 --- /dev/null +++ b/test/files/neg/macro-invalidsig/Macros_Test_2.scala @@ -0,0 +1,83 @@ +object Macros1 { + def foo[U] = macro Impls1.foo[U] +} + +object Macros2 { + def foo = macro Impls2.foo +} + +object Macros3 { + def foo = macro Impls3.foo +} + +object Macros4 { + def foo = macro Impls4.foo +} + +object Macros5 { + def foo(x: Any) = macro Impls5.foo +} + +class Macros6[T] { + def foo[U](x: Int) = macro Impls6.foo[T, U] +} + +object Macros7 { + def foo(x: Int) = macro Impls7.foo +} + +object Macros8 { + def foo(x: Int) = macro Impls8.foo +} + +object Macros9 { + def foo(x: Int, y: Int) = macro Impls9.foo +} + +object Macros10 { + def foo(x: Int, y: Int) = macro Impls10.foo +} + +object Macros11 { + def foo[U] = macro Impls11.foo[U] +} + +object Macros12 { + def foo[U] = macro Impls12.foo[U] +} + +object Macros13 { + def foo[U <: Int] = macro Impls13.foo[U] +} + +object Macros14 { + def foo = macro Impls14.foo +} + +class D[T] { + class C[U] { + def foo15[V] = macro Impls15.foo + def foo16[V] = macro Impls16.foo[V] + } +} + +object Test extends App { + println(Macros1.foo[String]) + println(Macros2.foo) + println(Macros3.foo) + println(Macros4.foo) + println(Macros5.foo(42)) + println(new Macros6[Int]().foo[String](42)) + println(Macros7.foo(42)) + println(Macros8.foo) + println(Macros9.foo(4, 2)) + println(Macros10.foo(4, 2)) + println(Macros11.foo[Int]) + println(Macros12.foo[Int]) + println(Macros13.foo[Int]) + println(Macros14.foo) + val outer1 = new D[Int] + val outer2 = new outer1.C[String] + outer2.foo15[Boolean] + outer2.foo16[Boolean] +}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidusage-badargs.check b/test/files/neg/macro-invalidusage-badargs.check index 294cfd0cf5..4c1115418b 100644 --- a/test/files/neg/macro-invalidusage-badargs.check +++ b/test/files/neg/macro-invalidusage-badargs.check @@ -1,6 +1,18 @@ -Macros_Test_2.scala:7: error: type mismatch; +Macros_Test_2.scala:5: error: type mismatch; found : String("42") required: Int - val s: String = foo("42") - ^ -one error found + foo("42") + ^ +Macros_Test_2.scala:6: error: too few argument lists for macro invocation + foo + ^ +Macros_Test_2.scala:7: error: Int does not take parameters + foo(4)(2) + ^ +Macros_Test_2.scala:8: error: macro applications do not support named and/or default arguments + foo() + ^ +Macros_Test_2.scala:9: error: too many arguments for macro method foo: (x: Int)Int + foo(4, 2) + ^ +5 errors found diff --git a/test/files/neg/macro-invalidusage-badargs/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-badargs/Macros_Test_2.scala index a6af1bb277..0b3ca0590b 100644 --- a/test/files/neg/macro-invalidusage-badargs/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidusage-badargs/Macros_Test_2.scala @@ -1,8 +1,10 @@ -object Macros { - def foo(x: Int) = macro Impls.foo -} +object Macros { def foo(x: Int) = macro Impls.foo } +import Macros._ object Test extends App { - import Macros._ - val s: String = foo("42") + foo("42") + foo + foo(4)(2) + foo() + foo(4, 2) }
\ No newline at end of file diff --git a/test/files/neg/macro-invalidusage-badbounds-a.check b/test/files/neg/macro-invalidusage-badbounds.check index 277f407d38..277f407d38 100644 --- a/test/files/neg/macro-invalidusage-badbounds-a.check +++ b/test/files/neg/macro-invalidusage-badbounds.check diff --git a/test/files/neg/macro-invalidimpl-e.flags b/test/files/neg/macro-invalidusage-badbounds.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidimpl-e.flags +++ b/test/files/neg/macro-invalidusage-badbounds.flags diff --git a/test/files/neg/macro-invalidusage-badbounds-a/Impls_1.scala b/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala index 6ee71a3628..6ee71a3628 100644 --- a/test/files/neg/macro-invalidusage-badbounds-a/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala diff --git a/test/files/neg/macro-invalidusage-badbounds-a/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala index 3139599108..3139599108 100644 --- a/test/files/neg/macro-invalidusage-badbounds-a/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala diff --git a/test/files/neg/macro-invalidusage-badtargs-untyped.check b/test/files/neg/macro-invalidusage-badtargs-untyped.check new file mode 100644 index 0000000000..1678180281 --- /dev/null +++ b/test/files/neg/macro-invalidusage-badtargs-untyped.check @@ -0,0 +1,18 @@ +Macros_Test_2.scala:11: error: macro method foo1: (x: _)Int does not take type parameters. + foo1[String](42) + ^ +Macros_Test_2.scala:12: error: wrong number of type parameters for macro method foo2: [T](x: _)Int + foo2[String, String](42) + ^ +Macros_Test_2.scala:13: error: wrong number of type parameters for macro method foo3: [T, U](x: _)Int + foo3[String](42) + ^ +Macros_Test_2.scala:14: error: String takes no type parameters, expected: one + foo4[String](42) + ^ +Macros_Test_2.scala:15: error: kinds of the type arguments (List) do not conform to the expected kinds of the type parameters (type T). +List's type parameters do not match type T's expected parameters: +type A has no type parameters, but type U has one + foo5[List](42) + ^ +5 errors found diff --git a/test/files/neg/macro-invalidimpl-f.flags b/test/files/neg/macro-invalidusage-badtargs-untyped.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidimpl-f.flags +++ b/test/files/neg/macro-invalidusage-badtargs-untyped.flags diff --git a/test/files/neg/macro-invalidusage-badtargs.check b/test/files/neg/macro-invalidusage-badtargs.check index 73801ab43e..6a9e1d6e6b 100644 --- a/test/files/neg/macro-invalidusage-badtargs.check +++ b/test/files/neg/macro-invalidusage-badtargs.check @@ -1,4 +1,18 @@ -Macros_Test_2.scala:7: error: macro method foo: (x: Int)Int does not take type parameters. - val s: String = foo[String](42) - ^ -one error found +Macros_Test_2.scala:11: error: macro method foo1: (x: Int)Int does not take type parameters. + foo1[String](42) + ^ +Macros_Test_2.scala:12: error: wrong number of type parameters for macro method foo2: [T](x: Int)Int + foo2[String, String](42) + ^ +Macros_Test_2.scala:13: error: wrong number of type parameters for macro method foo3: [T, U](x: Int)Int + foo3[String](42) + ^ +Macros_Test_2.scala:14: error: String takes no type parameters, expected: one + foo4[String](42) + ^ +Macros_Test_2.scala:15: error: kinds of the type arguments (List) do not conform to the expected kinds of the type parameters (type T). +List's type parameters do not match type T's expected parameters: +type A has no type parameters, but type U has one + foo5[List](42) + ^ +5 errors found diff --git a/test/files/neg/macro-invalidusage-badtargs/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-badtargs/Macros_Test_2.scala index c54093b637..fd16d163c3 100644 --- a/test/files/neg/macro-invalidusage-badtargs/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidusage-badtargs/Macros_Test_2.scala @@ -1,8 +1,16 @@ object Macros { - def foo(x: Int) = macro Impls.foo + def foo1(x: Int) = macro Impls.foo + def foo2[T](x: Int) = macro Impls.foo + def foo3[T, U](x: Int) = macro Impls.foo + def foo4[T[_]](x: Int) = macro Impls.foo + def foo5[T[U[_]]](x: Int) = macro Impls.foo } object Test extends App { import Macros._ - val s: String = foo[String](42) + foo1[String](42) + foo2[String, String](42) + foo3[String](42) + foo4[String](42) + foo5[List](42) }
\ No newline at end of file diff --git a/test/files/neg/macro-invalidusage-nontypeable.check b/test/files/neg/macro-invalidusage-nontypeable.check new file mode 100644 index 0000000000..88e6057e5e --- /dev/null +++ b/test/files/neg/macro-invalidusage-nontypeable.check @@ -0,0 +1,4 @@ +Test_2.scala:2: error: not found: value IDoNotExist + Macros.foo + ^ +one error found diff --git a/test/files/neg/macro-invalidimpl-g.flags b/test/files/neg/macro-invalidusage-nontypeable.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidimpl-g.flags +++ b/test/files/neg/macro-invalidusage-nontypeable.flags diff --git a/test/files/neg/macro-invalidusage-nontypeable/Impls_Macros_1.scala b/test/files/neg/macro-invalidusage-nontypeable/Impls_Macros_1.scala new file mode 100644 index 0000000000..869a5a41fa --- /dev/null +++ b/test/files/neg/macro-invalidusage-nontypeable/Impls_Macros_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.{Context => Ctx} + +object Impls { + def foo(c: Ctx) = { + import c.universe._ + val body = Ident(TermName("IDoNotExist")) + c.Expr[Int](body) + } +} + +object Macros { + def foo = macro Impls.foo +}
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-b/Test_2.scala b/test/files/neg/macro-invalidusage-nontypeable/Test_2.scala index 7dffc5107d..acfddae942 100644 --- a/test/files/run/macro-def-path-dependent-b/Test_2.scala +++ b/test/files/neg/macro-invalidusage-nontypeable/Test_2.scala @@ -1,3 +1,3 @@ object Test extends App { - println("it works") + Macros.foo }
\ No newline at end of file diff --git a/test/files/neg/macro-invalidusage-presuper.check b/test/files/neg/macro-invalidusage-presuper.check new file mode 100644 index 0000000000..f63a0eef80 --- /dev/null +++ b/test/files/neg/macro-invalidusage-presuper.check @@ -0,0 +1,4 @@ +Macros_Test_2.scala:3: error: only type definitions and concrete field definitions allowed in early object initialization section +class D extends { def x = macro impl } with AnyRef + ^ +one error found diff --git a/test/files/neg/macro-invalidimpl-h.flags b/test/files/neg/macro-invalidusage-presuper.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidimpl-h.flags +++ b/test/files/neg/macro-invalidusage-presuper.flags diff --git a/test/files/neg/macro-invalidusage-presuper/Impls_1.scala b/test/files/neg/macro-invalidusage-presuper/Impls_1.scala new file mode 100644 index 0000000000..b39a037c47 --- /dev/null +++ b/test/files/neg/macro-invalidusage-presuper/Impls_1.scala @@ -0,0 +1,5 @@ +import scala.reflect.macros.Context + +object Impls { + def impl(c: Context) = c.literalUnit +}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidusage-presuper/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-presuper/Macros_Test_2.scala new file mode 100644 index 0000000000..ff46a5915f --- /dev/null +++ b/test/files/neg/macro-invalidusage-presuper/Macros_Test_2.scala @@ -0,0 +1,3 @@ +import Impls._ + +class D extends { def x = macro impl } with AnyRef
\ No newline at end of file diff --git a/test/files/neg/macro-qmarkqmarkqmark.check b/test/files/neg/macro-qmarkqmarkqmark.check index afd49e7d90..bc3e25edaf 100644 --- a/test/files/neg/macro-qmarkqmarkqmark.check +++ b/test/files/neg/macro-qmarkqmarkqmark.check @@ -1,7 +1,7 @@ macro-qmarkqmarkqmark.scala:5: error: macro implementation is missing foo1 ^ -macro-qmarkqmarkqmark.scala:8: error: macros cannot be partially applied +macro-qmarkqmarkqmark.scala:8: error: too few argument lists for macro invocation foo2 ^ macro-qmarkqmarkqmark.scala:9: error: macro implementation is missing diff --git a/test/files/neg/no-implicit-to-anyref.check b/test/files/neg/no-implicit-to-anyref.check index d94b57a30a..fe417ad8b0 100644 --- a/test/files/neg/no-implicit-to-anyref.check +++ b/test/files/neg/no-implicit-to-anyref.check @@ -1,10 +1,4 @@ -no-implicit-to-anyref.scala:11: error: type mismatch; - found : Int(1) - required: AnyRef -Note: an implicit exists from scala.Int => java.lang.Integer, but -methods inherited from Object are rendered ambiguous. This is to avoid -a blanket implicit which would convert any scala.Int to any AnyRef. -You may wish to use a type ascription: `x: java.lang.Integer`. +no-implicit-to-anyref.scala:11: error: the result type of an implicit conversion must be more specific than AnyRef 1: AnyRef ^ no-implicit-to-anyref.scala:17: error: type mismatch; diff --git a/test/files/neg/t4158.check b/test/files/neg/t4158.check index 3ee2627c5b..af281c52cd 100644 --- a/test/files/neg/t4158.check +++ b/test/files/neg/t4158.check @@ -1,19 +1,7 @@ -t4158.scala:3: error: type mismatch; - found : Null(null) - required: Int -Note that implicit conversions are not applicable because they are ambiguous: - both method Integer2intNullConflict in class LowPriorityImplicits of type (x: Null)Int - and method Integer2int in object Predef of type (x: Integer)Int - are possible conversion functions from Null(null) to Int +t4158.scala:3: error: an expression of type Null is ineligible for implicit conversion var y = null: Int ^ -t4158.scala:2: error: type mismatch; - found : Null(null) - required: Int -Note that implicit conversions are not applicable because they are ambiguous: - both method Integer2intNullConflict in class LowPriorityImplicits of type (x: Null)Int - and method Integer2int in object Predef of type (x: Integer)Int - are possible conversion functions from Null(null) to Int +t4158.scala:2: error: an expression of type Null is ineligible for implicit conversion var x: Int = null ^ two errors found diff --git a/test/files/neg/t4515.check b/test/files/neg/t4515.check index a60d16295f..64e7cc1ca7 100644 --- a/test/files/neg/t4515.check +++ b/test/files/neg/t4515.check @@ -1,6 +1,6 @@ t4515.scala:37: error: type mismatch; - found : _0(in value $anonfun) where type _0(in value $anonfun) - required: (some other)_0(in value $anonfun) + found : _$1 where type _$1 + required: _$2 handler.onEvent(target, ctx.getEvent, node, ctx) ^ one error found diff --git a/test/files/neg/t4727.check b/test/files/neg/t4727.check index 8a4536fec3..a17cdde044 100644 --- a/test/files/neg/t4727.check +++ b/test/files/neg/t4727.check @@ -1,10 +1,4 @@ -t4727.scala:5: error: type mismatch; - found : Null - required: Int -Note that implicit conversions are not applicable because they are ambiguous: - both method Integer2intNullConflict in class LowPriorityImplicits of type (x: Null)Int - and method Integer2int in object Predef of type (x: Integer)Int - are possible conversion functions from Null to Int +t4727.scala:5: error: an expression of type Null is ineligible for implicit conversion Error occurred in an application involving default arguments. new C[Int] ^ diff --git a/test/files/neg/t5689.check b/test/files/neg/t5689.check index 50aaa7dbfe..ad9b79cdcb 100644 --- a/test/files/neg/t5689.check +++ b/test/files/neg/t5689.check @@ -3,5 +3,5 @@ t5689.scala:4: error: macro implementation has wrong shape: found : (c: scala.reflect.macros.Context)(i: c.Expr[Double]): c.Expr[Int] type mismatch for return type: c.Expr[Int] does not conform to c.Expr[String] def returnsString(i: Double): String = macro returnsIntImpl - ^ + ^ one error found diff --git a/test/files/neg/t6138.check b/test/files/neg/t6138.check new file mode 100644 index 0000000000..8fd9978248 --- /dev/null +++ b/test/files/neg/t6138.check @@ -0,0 +1,7 @@ +t6138.scala:4: error: ambiguous reference to overloaded definition, +both method getClass in object definitions of type (s: Int)Any +and method getClass in object definitions of type (s: String)Any +match argument types (Nothing) + getClass(???): String + ^ +one error found diff --git a/test/files/neg/t6138.scala b/test/files/neg/t6138.scala new file mode 100644 index 0000000000..2f45a46b1c --- /dev/null +++ b/test/files/neg/t6138.scala @@ -0,0 +1,5 @@ +object definitions { + def getClass(s: String): Any = ??? + def getClass(s: Int): Any = ??? + getClass(???): String +} diff --git a/test/files/neg/t6889.check b/test/files/neg/t6889.check new file mode 100644 index 0000000000..a77e8a010c --- /dev/null +++ b/test/files/neg/t6889.check @@ -0,0 +1,7 @@ +t6889.scala:16: error: the result type of an implicit conversion must be more specific than AnyRef + def f(x: Dingo): AnyRef = x // fail - no conversion to AnyRef + ^ +t6889.scala:17: error: an expression of type Null is ineligible for implicit conversion + var x: Int = null // fail - no conversion from Null + ^ +two errors found diff --git a/test/files/neg/t6889.scala b/test/files/neg/t6889.scala new file mode 100644 index 0000000000..ef1963669c --- /dev/null +++ b/test/files/neg/t6889.scala @@ -0,0 +1,18 @@ +package bippy { + trait Bippy[A] extends Any +} +package foo { + package object unrelated { + implicit def bippyDingo[A](x: bippy.Bippy[A]): AnyRef = Nil + } + package unrelated { + trait Unrelated + } +} + +object Test { + trait Dingo extends Any with bippy.Bippy[foo.unrelated.Unrelated] + + def f(x: Dingo): AnyRef = x // fail - no conversion to AnyRef + var x: Int = null // fail - no conversion from Null +} diff --git a/test/files/neg/t7157.check b/test/files/neg/t7157.check new file mode 100644 index 0000000000..c6a7af9a23 --- /dev/null +++ b/test/files/neg/t7157.check @@ -0,0 +1,73 @@ +Test_2.scala:5: error: too many arguments for macro method m1_0_0: ()Unit + m1_0_0(1) + ^ +Test_2.scala:6: error: too many arguments for macro method m1_0_0: ()Unit + m1_0_0(1, 2) + ^ +Test_2.scala:7: error: too many arguments for macro method m1_0_0: ()Unit + m1_0_0(1, 2, 3) + ^ +Test_2.scala:9: error: macro applications do not support named and/or default arguments + m1_1_1() + ^ +Test_2.scala:11: error: too many arguments for macro method m1_1_1: (x: Int)Unit + m1_1_1(1, 2) + ^ +Test_2.scala:12: error: too many arguments for macro method m1_1_1: (x: Int)Unit + m1_1_1(1, 2, 3) + ^ +Test_2.scala:14: error: macro applications do not support named and/or default arguments + m1_2_2() + ^ +Test_2.scala:15: error: macro applications do not support named and/or default arguments + m1_2_2(1) + ^ +Test_2.scala:17: error: too many arguments for macro method m1_2_2: (x: Int, y: Int)Unit + m1_2_2(1, 2, 3) + ^ +Test_2.scala:24: error: macro applications do not support named and/or default arguments + m1_1_inf() + ^ +Test_2.scala:29: error: macro applications do not support named and/or default arguments + m1_2_inf() + ^ +Test_2.scala:30: error: macro applications do not support named and/or default arguments + m1_2_inf(1) + ^ +Test_2.scala:35: error: too many arguments for macro method m2_0_0: ()Unit + m2_0_0()(1) + ^ +Test_2.scala:36: error: too many arguments for macro method m2_0_0: ()Unit + m2_0_0()(1, 2) + ^ +Test_2.scala:37: error: too many arguments for macro method m2_0_0: ()Unit + m2_0_0()(1, 2, 3) + ^ +Test_2.scala:39: error: macro applications do not support named and/or default arguments + m2_1_1()() + ^ +Test_2.scala:41: error: too many arguments for macro method m2_1_1: (x: Int)Unit + m2_1_1()(1, 2) + ^ +Test_2.scala:42: error: too many arguments for macro method m2_1_1: (x: Int)Unit + m2_1_1()(1, 2, 3) + ^ +Test_2.scala:44: error: macro applications do not support named and/or default arguments + m2_2_2()() + ^ +Test_2.scala:45: error: macro applications do not support named and/or default arguments + m2_2_2()(1) + ^ +Test_2.scala:47: error: too many arguments for macro method m2_2_2: (x: Int, y: Int)Unit + m2_2_2()(1, 2, 3) + ^ +Test_2.scala:54: error: macro applications do not support named and/or default arguments + m2_1_inf()() + ^ +Test_2.scala:59: error: macro applications do not support named and/or default arguments + m2_2_inf()() + ^ +Test_2.scala:60: error: macro applications do not support named and/or default arguments + m2_2_inf()(1) + ^ +24 errors found diff --git a/test/files/neg/t7157/Impls_Macros_1.scala b/test/files/neg/t7157/Impls_Macros_1.scala new file mode 100644 index 0000000000..09f423fbab --- /dev/null +++ b/test/files/neg/t7157/Impls_Macros_1.scala @@ -0,0 +1,32 @@ +import scala.reflect.macros.Context +import language.experimental.macros + +object Macros { + def impl1_0_0(c: Context)() = c.literalUnit + def impl1_1_1(c: Context)(x: c.Expr[Int]) = c.literalUnit + def impl1_2_2(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = c.literalUnit + def m1_0_0() = macro impl1_0_0 + def m1_1_1(x: Int) = macro impl1_1_1 + def m1_2_2(x: Int, y: Int) = macro impl1_2_2 + + def impl1_0_inf(c: Context)(x: c.Expr[Int]*) = c.literalUnit + def impl1_1_inf(c: Context)(x: c.Expr[Int], y: c.Expr[Int]*) = c.literalUnit + def impl1_2_inf(c: Context)(x: c.Expr[Int], y: c.Expr[Int], z: c.Expr[Int]*) = c.literalUnit + def m1_0_inf(x: Int*) = macro impl1_0_inf + def m1_1_inf(x: Int, y: Int*) = macro impl1_1_inf + def m1_2_inf(x: Int, y: Int, z: Int*) = macro impl1_2_inf + + def impl2_0_0(c: Context)()() = c.literalUnit + def impl2_1_1(c: Context)()(x: c.Expr[Int]) = c.literalUnit + def impl2_2_2(c: Context)()(x: c.Expr[Int], y: c.Expr[Int]) = c.literalUnit + def m2_0_0()() = macro impl2_0_0 + def m2_1_1()(x: Int) = macro impl2_1_1 + def m2_2_2()(x: Int, y: Int) = macro impl2_2_2 + + def impl2_0_inf(c: Context)()(x: c.Expr[Int]*) = c.literalUnit + def impl2_1_inf(c: Context)()(x: c.Expr[Int], y: c.Expr[Int]*) = c.literalUnit + def impl2_2_inf(c: Context)()(x: c.Expr[Int], y: c.Expr[Int], z: c.Expr[Int]*) = c.literalUnit + def m2_0_inf()(x: Int*) = macro impl2_0_inf + def m2_1_inf()(x: Int, y: Int*) = macro impl2_1_inf + def m2_2_inf()(x: Int, y: Int, z: Int*) = macro impl2_2_inf +}
\ No newline at end of file diff --git a/test/files/neg/t7157/Test_2.scala b/test/files/neg/t7157/Test_2.scala new file mode 100644 index 0000000000..45a6026399 --- /dev/null +++ b/test/files/neg/t7157/Test_2.scala @@ -0,0 +1,63 @@ +import Macros._ + +object Test extends App { + m1_0_0() + m1_0_0(1) + m1_0_0(1, 2) + m1_0_0(1, 2, 3) + + m1_1_1() + m1_1_1(1) + m1_1_1(1, 2) + m1_1_1(1, 2, 3) + + m1_2_2() + m1_2_2(1) + m1_2_2(1, 2) + m1_2_2(1, 2, 3) + + m1_0_inf() + m1_0_inf(1) + m1_0_inf(1, 2) + m1_0_inf(1, 2, 3) + + m1_1_inf() + m1_1_inf(1) + m1_1_inf(1, 2) + m1_1_inf(1, 2, 3) + + m1_2_inf() + m1_2_inf(1) + m1_2_inf(1, 2) + m1_2_inf(1, 2, 3) + + m2_0_0()() + m2_0_0()(1) + m2_0_0()(1, 2) + m2_0_0()(1, 2, 3) + + m2_1_1()() + m2_1_1()(1) + m2_1_1()(1, 2) + m2_1_1()(1, 2, 3) + + m2_2_2()() + m2_2_2()(1) + m2_2_2()(1, 2) + m2_2_2()(1, 2, 3) + + m2_0_inf()() + m2_0_inf()(1) + m2_0_inf()(1, 2) + m2_0_inf()(1, 2, 3) + + m2_1_inf()() + m2_1_inf()(1) + m2_1_inf()(1, 2) + m2_1_inf()(1, 2, 3) + + m2_2_inf()() + m2_2_inf()(1) + m2_2_inf()(1, 2) + m2_2_inf()(1, 2, 3) +}
\ No newline at end of file diff --git a/test/files/neg/t7292-deprecation.check b/test/files/neg/t7292-deprecation.check new file mode 100644 index 0000000000..17f010dfdf --- /dev/null +++ b/test/files/neg/t7292-deprecation.check @@ -0,0 +1,12 @@ +t7292-deprecation.scala:2: warning: Octal escape literals are deprecated, use \u0000 instead. + val chr1 = '\0' + ^ +t7292-deprecation.scala:3: warning: Octal escape literals are deprecated, use \u0053 instead. + val str1 = "abc\123456" + ^ +t7292-deprecation.scala:4: warning: Octal escape literals are deprecated, use \n instead. + val lf = '\012' + ^ +error: No warnings can be incurred under -Xfatal-warnings. +three warnings found +one error found diff --git a/test/files/neg/t7292-deprecation.flags b/test/files/neg/t7292-deprecation.flags new file mode 100644 index 0000000000..7de3c0f3ee --- /dev/null +++ b/test/files/neg/t7292-deprecation.flags @@ -0,0 +1 @@ +-Xfatal-warnings -deprecation diff --git a/test/files/neg/t7292-deprecation.scala b/test/files/neg/t7292-deprecation.scala new file mode 100644 index 0000000000..d857f0e1ec --- /dev/null +++ b/test/files/neg/t7292-deprecation.scala @@ -0,0 +1,5 @@ +object OctalEscapes { + val chr1 = '\0' + val str1 = "abc\123456" + val lf = '\012' +} diff --git a/test/files/neg/t7292-removal.check b/test/files/neg/t7292-removal.check new file mode 100644 index 0000000000..1cd59b0992 --- /dev/null +++ b/test/files/neg/t7292-removal.check @@ -0,0 +1,10 @@ +t7292-removal.scala:2: error: Octal escape literals are unsupported, use \u0000 instead. + val chr1 = '\0' + ^ +t7292-removal.scala:3: error: Octal escape literals are unsupported, use \u0053 instead. + val str1 = "abc\123456" + ^ +t7292-removal.scala:4: error: Octal escape literals are unsupported, use \n instead. + val lf = '\012' + ^ +three errors found diff --git a/test/files/neg/t7292-removal.flags b/test/files/neg/t7292-removal.flags new file mode 100644 index 0000000000..29f4ede37a --- /dev/null +++ b/test/files/neg/t7292-removal.flags @@ -0,0 +1 @@ +-Xfuture diff --git a/test/files/neg/t7292-removal.scala b/test/files/neg/t7292-removal.scala new file mode 100644 index 0000000000..d857f0e1ec --- /dev/null +++ b/test/files/neg/t7292-removal.scala @@ -0,0 +1,5 @@ +object OctalEscapes { + val chr1 = '\0' + val str1 = "abc\123456" + val lf = '\012' +} diff --git a/test/files/neg/t7441.check b/test/files/neg/t7441.check deleted file mode 100644 index f259457197..0000000000 --- a/test/files/neg/t7441.check +++ /dev/null @@ -1,6 +0,0 @@ -t7441.scala:4: error: type mismatch; - found : Int(1) - required: List[Any] - def test = apply(1) - ^ -one error found diff --git a/test/files/neg/t7441.scala b/test/files/neg/t7441.scala deleted file mode 100644 index dad7421e3f..0000000000 --- a/test/files/neg/t7441.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Test { - object Bar { - def apply(xs: List[Any]): Int = 0 - def test = apply(1) - } - implicit def foo = 1 -} diff --git a/test/files/neg/t7473.check b/test/files/neg/t7473.check new file mode 100644 index 0000000000..bc8c29d463 --- /dev/null +++ b/test/files/neg/t7473.check @@ -0,0 +1,7 @@ +t7473.scala:6: error: '<-' expected but '=' found. + (for (x = Option(i); if x == j) yield 42) toList + ^ +t7473.scala:6: error: illegal start of simple expression + (for (x = Option(i); if x == j) yield 42) toList + ^ +two errors found diff --git a/test/files/neg/t7473.scala b/test/files/neg/t7473.scala new file mode 100644 index 0000000000..593231d5f2 --- /dev/null +++ b/test/files/neg/t7473.scala @@ -0,0 +1,7 @@ + +object Foo { + val i,j = 3 + //for (x = Option(i); if x == j) yield 42 //t7473.scala:4: error: '<-' expected but '=' found. + // evil postfix! + (for (x = Option(i); if x == j) yield 42) toList +} diff --git a/test/files/neg/t7507.check b/test/files/neg/t7507.check new file mode 100644 index 0000000000..d402869fd4 --- /dev/null +++ b/test/files/neg/t7507.check @@ -0,0 +1,4 @@ +t7507.scala:6: error: value bippy in trait Cake cannot be accessed in Cake + locally(bippy) + ^ +one error found diff --git a/test/files/neg/t7507.scala b/test/files/neg/t7507.scala new file mode 100644 index 0000000000..1b4756d955 --- /dev/null +++ b/test/files/neg/t7507.scala @@ -0,0 +1,7 @@ +trait Cake extends Slice { + private[this] val bippy = () +} + +trait Slice { self: Cake => + locally(bippy) +} diff --git a/test/files/neg/t7509.check b/test/files/neg/t7509.check new file mode 100644 index 0000000000..eaa6303cf5 --- /dev/null +++ b/test/files/neg/t7509.check @@ -0,0 +1,12 @@ +t7509.scala:3: error: inferred type arguments [Int] do not conform to method crash's type parameter bounds [R <: AnyRef] + crash(42) + ^ +t7509.scala:3: error: type mismatch; + found : Int(42) + required: R + crash(42) + ^ +t7509.scala:3: error: could not find implicit value for parameter ev: R + crash(42) + ^ +three errors found diff --git a/test/files/neg/t7509.scala b/test/files/neg/t7509.scala new file mode 100644 index 0000000000..3cba801ea7 --- /dev/null +++ b/test/files/neg/t7509.scala @@ -0,0 +1,4 @@ +object NMWE { + def crash[R <: AnyRef](f: R)(implicit ev: R): Any = ??? + crash(42) +} diff --git a/test/files/neg/t7519.check b/test/files/neg/t7519.check new file mode 100644 index 0000000000..164d67f595 --- /dev/null +++ b/test/files/neg/t7519.check @@ -0,0 +1,7 @@ +t7519.scala:5: error: could not find implicit value for parameter nada: Nothing + locally(0 : String) // was: "value conversion is not a member of C.this.C" + ^ +t7519.scala:15: error: could not find implicit value for parameter nada: Nothing + locally(0 : String) // was: "value conversion is not a member of U" + ^ +two errors found diff --git a/test/files/neg/t7519.scala b/test/files/neg/t7519.scala new file mode 100644 index 0000000000..aea0f35d8e --- /dev/null +++ b/test/files/neg/t7519.scala @@ -0,0 +1,18 @@ +class C { + implicit def conversion(m: Int)(implicit nada: Nothing): String = ??? + + class C { // rename class to get correct error, can't find implicit: Nothing. + locally(0 : String) // was: "value conversion is not a member of C.this.C" + } +} + +object Test2 { + trait T; trait U + new T { + implicit def conversion(m: Int)(implicit nada: Nothing): String = ??? + + new U { // nested anonymous classes also share a name. + locally(0 : String) // was: "value conversion is not a member of U" + } + } +} diff --git a/test/files/pos/lub-dealias-widen.scala b/test/files/pos/lub-dealias-widen.scala new file mode 100644 index 0000000000..38854fbc5c --- /dev/null +++ b/test/files/pos/lub-dealias-widen.scala @@ -0,0 +1,34 @@ +import scala.language.higherKinds + +sealed trait Path { + type EncodeFunc + type Route[R] = List[String] => R + + def >>(f: Route[Int]): Sitelet[EncodeFunc] = ??? +} + +case object PAny extends Path { + type EncodeFunc = List[String] => String +} + +case class PLit[Next <: Path]() extends Path { + type EncodeFunc = Next#EncodeFunc +} + +trait Sitelet[EncodeFunc] { self => + def &[G <: H, H >: EncodeFunc](that: Sitelet[G]): Sitelet[H] = ??? +} + +object Test { + val r: Sitelet[Int => (Int => String)] = ??? + + val p2: PLit[PAny.type] = ??? + val r2 /*: Sitelet[List[String] => String] */ // annotate type and it compiles with 2.10.0 + = p2 >> { (xs: List[String]) => 0 } + + // This works after https://github.com/scala/scala/commit/a06d31f6a + // Before: error: inferred type arguments [List[String] => String,List[String] => String] + // do not conform to method &'s type parameter bounds + // [G <: H,H >: Int => (Int => String)] + val s = r & r2 +}
\ No newline at end of file diff --git a/test/files/pos/t2613.scala b/test/files/pos/t2613.scala new file mode 100644 index 0000000000..3a64dbc282 --- /dev/null +++ b/test/files/pos/t2613.scala @@ -0,0 +1,11 @@ +import language.existentials + +object Test { + class Row + + abstract class MyRelation [R <: Row, +Relation <: MyRelation[R, Relation]] + + type M = MyRelation[R, Relation] forSome {type R <: Row; type Relation <: MyRelation[R, Relation]} + + var (x,y): (String, M) = null +} diff --git a/test/files/pos/t3936/BlockingQueue.java b/test/files/pos/t3936/BlockingQueue.java new file mode 100644 index 0000000000..b902d4528d --- /dev/null +++ b/test/files/pos/t3936/BlockingQueue.java @@ -0,0 +1,3 @@ +package pack; +import java.util.Queue; +public interface BlockingQueue<E> extends Queue<E> { } diff --git a/test/files/pos/t3936/Queue.java b/test/files/pos/t3936/Queue.java new file mode 100644 index 0000000000..25c9087601 --- /dev/null +++ b/test/files/pos/t3936/Queue.java @@ -0,0 +1,2 @@ +package pack; +public interface Queue { } diff --git a/test/files/pos/t3936/Test.scala b/test/files/pos/t3936/Test.scala new file mode 100644 index 0000000000..c867a05ec9 --- /dev/null +++ b/test/files/pos/t3936/Test.scala @@ -0,0 +1,4 @@ +package pack +trait Test { + val b: BlockingQueue[Nothing] +} diff --git a/test/files/pos/t5022.scala b/test/files/pos/t5022.scala new file mode 100644 index 0000000000..b9a085fb35 --- /dev/null +++ b/test/files/pos/t5022.scala @@ -0,0 +1,22 @@ +class ForSomeVsUnapply { + def test { + def makeWrap: Wrap = ??? + def useRep[e](rep: (e, X[e])) = () + + val repUnapply = Wrap.unapply(makeWrap).get + useRep(repUnapply) // okay + + val Wrap(rep0) = makeWrap + useRep(rep0) // error + + val rep = makeWrap match { + case Wrap(r) => r + }; + + useRep(rep) // error + } +} + +class X[e] + +case class Wrap(rep: (e, X[e]) forSome { type e }) diff --git a/test/files/pos/t7234.scala b/test/files/pos/t7234.scala deleted file mode 100644 index 59a233d835..0000000000 --- a/test/files/pos/t7234.scala +++ /dev/null @@ -1,15 +0,0 @@ -trait Main { - trait A { - type B - } - trait C { - def c(a: A, x: Int = 0)(b: a.B) - } - def c: C - def d(a: A, x: Int = 0)(b: a.B) - - def ok1(a: A)(b: a.B) = c.c(a, 42)(b) - def ok2(a: A)(b: a.B) = d(a)(b) - - def fail(a: A)(b: a.B) = c.c(a)(b) -} diff --git a/test/files/pos/t7234b.scala b/test/files/pos/t7234b.scala deleted file mode 100644 index fee98e87a8..0000000000 --- a/test/files/pos/t7234b.scala +++ /dev/null @@ -1,20 +0,0 @@ -trait Main { - trait A { - type B - def b: B - } - trait C { - def c(a: A, x: Int = 0)(b: => a.B, bs: a.B*) - def d(a: A = null, x: Int = 0)(b1: => a.B = a.b, b2: a.B = a.b) - } - def c: C - def ok(a: A)(b: a.B) = c.c(a, 42)(b) - def fail(a: A)(b: a.B) = c.c(a)(b) - def fail2(a: A)(b: a.B) = c.c(a)(b, b) - def fail3(a: A)(b: a.B) = c.c(a)(b, Seq[a.B](b): _*) - - def fail4(a: A)(b: a.B) = c.d(a)() - def fail5(a: A)(b: a.B) = c.d(a)(b1 = a.b) - def fail6(a: A)(b: a.B) = c.d(a)(b2 = a.b) - def fail7(a: A)(b: a.B) = c.d()() -} diff --git a/test/files/pos/t7264/A_1.scala b/test/files/pos/t7264/A_1.scala new file mode 100644 index 0000000000..044d0110a2 --- /dev/null +++ b/test/files/pos/t7264/A_1.scala @@ -0,0 +1,11 @@ +object Foo { + object Values { + implicit def fromInt(x: Int): Values = ??? + } + trait Values +} +final class Foo(name: String) { + def bar(values: Foo.Values): Bar = ??? +} + +trait Bar diff --git a/test/files/pos/t7264/B_2.scala b/test/files/pos/t7264/B_2.scala new file mode 100644 index 0000000000..869c51481d --- /dev/null +++ b/test/files/pos/t7264/B_2.scala @@ -0,0 +1,7 @@ +object Test { + // if the following line is uncommented, things compile + // type X = Foo.Values + + + def foo(f: Foo) = f.bar(0 /* : Foo.Values */) +} diff --git a/test/files/pos/t7364/BadList.java b/test/files/pos/t7364/BadList.java new file mode 100644 index 0000000000..2692fa085f --- /dev/null +++ b/test/files/pos/t7364/BadList.java @@ -0,0 +1,3 @@ +public class BadList extends java.util.ArrayList { + public java.util.ArrayList foo() { return null; } +} diff --git a/test/files/pos/t7364/UseIt.scala b/test/files/pos/t7364/UseIt.scala new file mode 100644 index 0000000000..3847165323 --- /dev/null +++ b/test/files/pos/t7364/UseIt.scala @@ -0,0 +1,4 @@ +class UseIt { + val list = new BadList + list.foo() +} diff --git a/test/files/pos/t7364b/BadList_1.java b/test/files/pos/t7364b/BadList_1.java new file mode 100644 index 0000000000..fbb428adba --- /dev/null +++ b/test/files/pos/t7364b/BadList_1.java @@ -0,0 +1,3 @@ +public class BadList_1 extends java.util.ArrayList { + public java.util.ArrayList foo() { return null; } +} diff --git a/test/files/pos/t7364b/UseIt_2.scala b/test/files/pos/t7364b/UseIt_2.scala new file mode 100644 index 0000000000..06b50f6766 --- /dev/null +++ b/test/files/pos/t7364b/UseIt_2.scala @@ -0,0 +1,5 @@ +class UseIt { + val list = new BadList_1 + list.foo() + list.set(0, list.get(0)) +} diff --git a/test/files/pos/t7433.flags b/test/files/pos/t7433.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/files/pos/t7433.flags @@ -0,0 +1 @@ +-Xfatal-warnings
\ No newline at end of file diff --git a/test/files/pos/t7433.scala b/test/files/pos/t7433.scala new file mode 100644 index 0000000000..f2109f4afa --- /dev/null +++ b/test/files/pos/t7433.scala @@ -0,0 +1,10 @@ +object Test { + def foo() { + try { + for (i <- 1 until 5) return + } catch { + case _: NullPointerException | _: RuntimeException => + // was: "catch block may intercept non-local return from method check" + } + } +} diff --git a/test/files/run/macro-expand-tparams-bounds-a.check b/test/files/pos/t7461.check index e69de29bb2..e69de29bb2 100644 --- a/test/files/run/macro-expand-tparams-bounds-a.check +++ b/test/files/pos/t7461.check diff --git a/test/files/pos/t7461/Macros_1.scala b/test/files/pos/t7461/Macros_1.scala new file mode 100644 index 0000000000..353dec66d7 --- /dev/null +++ b/test/files/pos/t7461/Macros_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.Context +import language.experimental.macros + +object Macros { + def impl(c: Context) = { + import c.universe._ + val wut = c.typeCheck(Select(Literal(Constant(10)), newTermName("$minus")), silent = true) + // println(showRaw(wut, printIds = true, printTypes = true)) + c.literalUnit + } + + def foo = macro impl +}
\ No newline at end of file diff --git a/test/files/pos/t7461/Test_2.scala b/test/files/pos/t7461/Test_2.scala new file mode 100644 index 0000000000..3839659c9a --- /dev/null +++ b/test/files/pos/t7461/Test_2.scala @@ -0,0 +1,3 @@ +class C { + def foo = Macros.foo +}
\ No newline at end of file diff --git a/test/files/pos/t7486.scala b/test/files/pos/t7486.scala deleted file mode 100644 index 6dd7f4c4ac..0000000000 --- a/test/files/pos/t7486.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test{ - var locker = 0 - // remove implicit, or change to `locker = locker + 1` to make it compile. - implicit val davyJones0 = { - locker += 0 - 0 - } -} diff --git a/test/files/pos/t7505.scala b/test/files/pos/t7505.scala new file mode 100644 index 0000000000..3e1e6ab8b4 --- /dev/null +++ b/test/files/pos/t7505.scala @@ -0,0 +1,16 @@ +import scala.language.reflectiveCalls + +case class ContextProperty(value: Any) { + type HasToInt = { def toInt:Int } + + def toInt: Int = value match { + case n: HasToInt => n.toInt + } +} + +// was: +// error:7: error during expansion of this match (this is a scalac bug). +// The underlying error was: type mismatch; +// found : Boolean(true) +// required: AnyRef +// def toInt: Int = value match {
\ No newline at end of file diff --git a/test/files/pos/t7516/A_1.scala b/test/files/pos/t7516/A_1.scala new file mode 100644 index 0000000000..3bba19966d --- /dev/null +++ b/test/files/pos/t7516/A_1.scala @@ -0,0 +1,9 @@ +import scala.reflect._,macros._, scala.language.experimental.macros + +object A { + def impl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = { + val r = c.universe.reify { List(t.splice) } + c.Expr[List[T]]( c.resetLocalAttrs(r.tree) ) + } + def demo[T](t: T): List[T] = macro impl[T] +} diff --git a/test/files/pos/t7516/B_2.scala b/test/files/pos/t7516/B_2.scala new file mode 100644 index 0000000000..1b8531bc85 --- /dev/null +++ b/test/files/pos/t7516/B_2.scala @@ -0,0 +1,4 @@ +object B { + final case class CV(p: Int = 3, g: Int = 2) + A.demo { val d = 4; CV(g = d); "a" } +} diff --git a/test/files/pos/t7517.scala b/test/files/pos/t7517.scala new file mode 100644 index 0000000000..7ce4c6b13e --- /dev/null +++ b/test/files/pos/t7517.scala @@ -0,0 +1,22 @@ +trait Box[ K[A[x]] ] + +object Box { + // type constructor composition + sealed trait ∙[A[_], B[_]] { type l[T] = A[B[T]] } + + // composes type constructors inside K + type SplitBox[K[A[x]], B[x]] = Box[ ({ type l[A[x]] = K[ (A ∙ B)#l] })#l ] + + def split[ K[A[x]], B[x] ](base: Box[K]): SplitBox[K,B] = ??? + + class Composed[B[_], L[A[x]] ] { + val box: Box[L] = ??? + + type Split[ A[x] ] = L[ (A ∙ B)#l ] + val a: Box[Split] = Box.split(box) + + //Either of these work: + val a1: Box[Split] = Box.split[L,B](box) + val a2: Box[ ({ type l[A[x]] = L[ (A ∙ B)#l ] })#l ] = Box.split(box) + } +}
\ No newline at end of file diff --git a/test/files/pos/t7520.scala b/test/files/pos/t7520.scala new file mode 100644 index 0000000000..747f5278e5 --- /dev/null +++ b/test/files/pos/t7520.scala @@ -0,0 +1,10 @@ +class A { + val x: Singleton with this.type = this + val y: this.type = x +} + +class B { + val x = "" + val xs: x.type with Singleton = x + val y: x.type = xs +} diff --git a/test/files/pos/t7532/A_1.java b/test/files/pos/t7532/A_1.java new file mode 100644 index 0000000000..1ade76cc70 --- /dev/null +++ b/test/files/pos/t7532/A_1.java @@ -0,0 +1,6 @@ +class R { + public class attr { // Will have the bytecode name `R$attr`, not to be confused with `R@tr`! + } + public static class attr1 { + } +} diff --git a/test/files/pos/t7532/B_2.scala b/test/files/pos/t7532/B_2.scala new file mode 100644 index 0000000000..ee7ce7751f --- /dev/null +++ b/test/files/pos/t7532/B_2.scala @@ -0,0 +1,5 @@ +object Test { + val r = new R + new r.attr() // Was: error while loading attr, class file '.../t7532-pos.obj/R$attr.class' has location not matching its contents: contains class + new R.attr1 +}
\ No newline at end of file diff --git a/test/files/pos/t7532b/A_1.scala b/test/files/pos/t7532b/A_1.scala new file mode 100644 index 0000000000..e8f9540609 --- /dev/null +++ b/test/files/pos/t7532b/A_1.scala @@ -0,0 +1,7 @@ +package pack +class R { + class attr // Will have the bytecode name `R$attr`, not to be confused with `R@tr`! + class `@` +} + +class `@`
\ No newline at end of file diff --git a/test/files/pos/t7532b/B_2.scala b/test/files/pos/t7532b/B_2.scala new file mode 100644 index 0000000000..1555a5daa7 --- /dev/null +++ b/test/files/pos/t7532b/B_2.scala @@ -0,0 +1,8 @@ +import pack._ + +object Test { + val r = new R + new r.attr() + new r.`@` + new `@` +}
\ No newline at end of file diff --git a/test/files/pos/t7584.scala b/test/files/pos/t7584.scala new file mode 100644 index 0000000000..52d127ecb9 --- /dev/null +++ b/test/files/pos/t7584.scala @@ -0,0 +1,11 @@ +object Test { + def fold[A, B](f: (A, => B) => B) = ??? + def f[A, B](x: A, y: B): B = ??? + def bip[A, B] = fold[A, B]((x, y) => f(x, y)) + def bop[A, B] = fold[A, B](f) + + // these work: + fold[Int, Int]((x, y) => f(x, y)) + fold[Int, Int](f) +} + diff --git a/test/files/run/classfile-format-51.scala b/test/files/run/classfile-format-51.scala index 9b1e612f4f..378caa7936 100644 --- a/test/files/run/classfile-format-51.scala +++ b/test/files/run/classfile-format-51.scala @@ -112,12 +112,12 @@ object Driver { System.setErr(System.out) try { // this test is only valid under JDK 1.7+ - // cheat a little by using 'ScalaVersion' because it can parse java versions just as well - val requiredJavaVersion = ScalaVersion("1.7") - val executingJavaVersion = ScalaVersion(System.getProperty("java.specification.version")) - if (executingJavaVersion >= requiredJavaVersion) { + testUnderJavaAtLeast("1.7") { generateClass() compile() + () + } otherwise { + () } } finally diff --git a/test/files/run/classfile-format-52.check b/test/files/run/classfile-format-52.check new file mode 100644 index 0000000000..5d24ef03cc --- /dev/null +++ b/test/files/run/classfile-format-52.check @@ -0,0 +1,2 @@ +hello from publicMethod +hello from staticMethod diff --git a/test/files/run/classfile-format-52.scala b/test/files/run/classfile-format-52.scala new file mode 100644 index 0000000000..7afa09ae0b --- /dev/null +++ b/test/files/run/classfile-format-52.scala @@ -0,0 +1,77 @@ +import java.io.{File, FileOutputStream} + +import scala.tools.nsc.settings.ScalaVersion +import scala.tools.partest._ +import scala.tools.asm +import asm.{AnnotationVisitor, ClassWriter, FieldVisitor, Handle, MethodVisitor, Opcodes} +import Opcodes._ + +// This test ensures that we can read JDK 8 (classfile format 52) files, including those +// with default methods. To do that it first uses ASM to generate an interface called +// HasDefaultMethod. Then it runs a normal compile on Scala source that extends that +// interface. Any failure will be dumped to std out. +// +// By it's nature the test can only work on JDK 8+ because under JDK 7- the +// interface won't verify. +object Test extends DirectTest { + override def extraSettings: String = "-optimise -usejavacp -d " + testOutput.path + " -cp " + testOutput.path + + def generateInterface() { + val interfaceName = "HasDefaultMethod" + val methodType = "()Ljava/lang/String;" + + val cw = new ClassWriter(0) + cw.visit(52, ACC_PUBLIC+ACC_ABSTRACT+ACC_INTERFACE, interfaceName, null, "java/lang/Object", null) + + def createMethod(flags:Int, name: String) { + val method = cw.visitMethod(flags, name, methodType, null, null) + method.visitCode() + method.visitLdcInsn(s"hello from $name") + method.visitInsn(ARETURN) + method.visitMaxs(1, 1) + method.visitEnd() + } + + createMethod(ACC_PUBLIC, "publicMethod") + createMethod(ACC_PUBLIC+ACC_STATIC, "staticMethod") + createMethod(ACC_PRIVATE, "privateMethod") + + cw.visitEnd() + val bytes = cw.toByteArray() + + val fos = new FileOutputStream(new File(s"${testOutput.path}/$interfaceName.class")) + try + fos write bytes + finally + fos.close() + + } + + def code = +""" +class Driver extends HasDefaultMethod { + println(publicMethod()) + println(HasDefaultMethod.staticMethod()) +} +""" + + override def show(): Unit = { + // redirect err to out, for logging + val prevErr = System.err + System.setErr(System.out) + try { + // this test is only valid under JDK 1.8+ + testUnderJavaAtLeast("1.8") { + generateInterface() + compile() + Class.forName("Driver").newInstance() + () + } otherwise { + println("hello from publicMethod") + println("hello from staticMethod") + } + } + finally + System.setErr(prevErr) + } +} diff --git a/test/files/run/duration-coarsest.scala b/test/files/run/duration-coarsest.scala new file mode 100644 index 0000000000..51cb79287a --- /dev/null +++ b/test/files/run/duration-coarsest.scala @@ -0,0 +1,28 @@ +import scala.concurrent.duration._ +import scala.language.postfixOps + +object Test extends App { + List( + (60 minutes, 1 hour), + (2000 millis, 2 seconds), + (2000 micros, 2 millis), + (2000 nanos, 2 micros), + (2000000 nanos, 2 millis), + (48 hours, 2 days), + (5 seconds, 5 seconds), + (1 second, 1 second) + ) foreach { + case (x, expected) => + val actual = x.toCoarsest + assert(actual.unit == expected.unit, s"$actual, $expected") + assert(actual.length == expected.length, s"$actual, $expected") + } + + List( + 45 minutes, + 500 millis, + 1500 millis, + 23 hours, + 40 days + ) foreach (x => assert(x == x.toCoarsest, x)) +}
\ No newline at end of file diff --git a/test/files/run/literals.check b/test/files/run/literals.check index 6be5137994..5f948762b7 100644 --- a/test/files/run/literals.check +++ b/test/files/run/literals.check @@ -1,4 +1,4 @@ -warning: there were 13 deprecation warning(s); re-run with -deprecation for details +warning: there were 18 deprecation warning(s); re-run with -deprecation for details test '\u0024' == '$' was successful test '\u005f' == '_' was successful test 65.asInstanceOf[Char] == 'A' was successful diff --git a/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala b/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala index 9c1e4ee46d..56c5252f31 100644 --- a/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala +++ b/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala @@ -7,6 +7,8 @@ object Impls { def refToFoo_impl(c: Ctx)(dummy: c.Expr[Int]) = { import c.universe._ val body = Select(Ident(TermName("Impls")), TermName("foo")) + val global = c.universe.asInstanceOf[scala.tools.nsc.Global] + global.analyzer.markMacroImplRef(body.asInstanceOf[global.Tree]) c.Expr[Int](body) } }
\ No newline at end of file diff --git a/test/files/run/macro-bundle.check b/test/files/run/macro-bundle.check new file mode 100644 index 0000000000..2107454960 --- /dev/null +++ b/test/files/run/macro-bundle.check @@ -0,0 +1,3 @@ +() +Int +() diff --git a/test/files/neg/macro-invalidimpl-i.flags b/test/files/run/macro-bundle.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidimpl-i.flags +++ b/test/files/run/macro-bundle.flags diff --git a/test/files/run/macro-bundle/Impls_Macros_1.scala b/test/files/run/macro-bundle/Impls_Macros_1.scala new file mode 100644 index 0000000000..3f651c9a43 --- /dev/null +++ b/test/files/run/macro-bundle/Impls_Macros_1.scala @@ -0,0 +1,13 @@ +import scala.reflect.macros.Context +import scala.reflect.macros.Macro + +trait Impl extends Macro { + def mono = c.literalUnit + def poly[T: c.WeakTypeTag] = c.literal(c.weakTypeOf[T].toString) + def weird = macro mono +} + +object Macros { + def mono = macro Impl.mono + def poly[T] = macro Impl.poly[T] +}
\ No newline at end of file diff --git a/test/files/run/macro-bundle/Test_2.scala b/test/files/run/macro-bundle/Test_2.scala new file mode 100644 index 0000000000..428f809f9d --- /dev/null +++ b/test/files/run/macro-bundle/Test_2.scala @@ -0,0 +1,5 @@ +object Test extends App { + println(Macros.mono) + println(Macros.poly[Int]) + println(new Impl{val c = ???}.weird) +}
\ No newline at end of file diff --git a/test/files/run/macro-def-infer-return-type-a.check b/test/files/run/macro-def-infer-return-type-a.check deleted file mode 100644 index f70d7bba4a..0000000000 --- a/test/files/run/macro-def-infer-return-type-a.check +++ /dev/null @@ -1 +0,0 @@ -42
\ No newline at end of file diff --git a/test/files/run/macro-def-infer-return-type-a.flags b/test/files/run/macro-def-infer-return-type-a.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-def-infer-return-type-a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-def-infer-return-type-a/Impls_1.scala b/test/files/run/macro-def-infer-return-type-a/Impls_1.scala deleted file mode 100644 index 52c9f9c3e9..0000000000 --- a/test/files/run/macro-def-infer-return-type-a/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo(c: Ctx)(x: c.Expr[Int]) = x -} diff --git a/test/files/run/macro-def-infer-return-type-a/Macros_Test_2.scala b/test/files/run/macro-def-infer-return-type-a/Macros_Test_2.scala deleted file mode 100644 index 60fe9dc1c2..0000000000 --- a/test/files/run/macro-def-infer-return-type-a/Macros_Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - def foo(x: Int) = macro Impls.foo - println(foo(42)) -}
\ No newline at end of file diff --git a/test/files/run/macro-def-infer-return-type-b.flags b/test/files/run/macro-def-infer-return-type-b.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-def-infer-return-type-b.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-def-infer-return-type-b/Impls_Macros_1.scala b/test/files/run/macro-def-infer-return-type-b/Impls_Macros_1.scala deleted file mode 100644 index 8a0f18c01b..0000000000 --- a/test/files/run/macro-def-infer-return-type-b/Impls_Macros_1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[T](c: Ctx)(x: c.Expr[T]) = - throw new Error("an implementation is missing") -} - -object Macros { - def foo[T](x: T) = macro Impls.foo[T] -}
\ No newline at end of file diff --git a/test/files/run/macro-def-infer-return-type-b/Test_2.scala b/test/files/run/macro-def-infer-return-type-b/Test_2.scala deleted file mode 100644 index 9e57b90b57..0000000000 --- a/test/files/run/macro-def-infer-return-type-b/Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test extends App { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) - try cm.mkToolBox().eval(tree) - catch { case ex: Throwable => println(ex.getMessage) } -} diff --git a/test/files/run/macro-def-infer-return-type-c.check b/test/files/run/macro-def-infer-return-type-c.check deleted file mode 100644 index f70d7bba4a..0000000000 --- a/test/files/run/macro-def-infer-return-type-c.check +++ /dev/null @@ -1 +0,0 @@ -42
\ No newline at end of file diff --git a/test/files/run/macro-def-infer-return-type-c.flags b/test/files/run/macro-def-infer-return-type-c.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-def-infer-return-type-c.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-def-infer-return-type-c/Impls_1.scala b/test/files/run/macro-def-infer-return-type-c/Impls_1.scala deleted file mode 100644 index 78db67eebf..0000000000 --- a/test/files/run/macro-def-infer-return-type-c/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[T](c: Ctx)(x: c.Expr[T]): c.Expr[T] = x -} diff --git a/test/files/run/macro-def-infer-return-type-c/Macros_Test_2.scala b/test/files/run/macro-def-infer-return-type-c/Macros_Test_2.scala deleted file mode 100644 index 967d16f6de..0000000000 --- a/test/files/run/macro-def-infer-return-type-c/Macros_Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - def foo[T](x: T) = macro Impls.foo[T] - println(foo(42)) -}
\ No newline at end of file diff --git a/test/files/run/macro-def-infer-return-type-b.check b/test/files/run/macro-def-infer-return-type.check index ae2dc7a06f..308e881960 100644 --- a/test/files/run/macro-def-infer-return-type-b.check +++ b/test/files/run/macro-def-infer-return-type.check @@ -1,6 +1,8 @@ +42 reflective compilation has failed: exception during macro expansion: java.lang.Error: an implementation is missing - at Impls$.foo(Impls_Macros_1.scala:5) + at Impls2$.foo(Impls_1.scala:9) +42 diff --git a/test/files/neg/macro-invalidret-nontree.flags b/test/files/run/macro-def-infer-return-type.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidret-nontree.flags +++ b/test/files/run/macro-def-infer-return-type.flags diff --git a/test/files/run/macro-def-infer-return-type/Impls_1.scala b/test/files/run/macro-def-infer-return-type/Impls_1.scala new file mode 100644 index 0000000000..f8636fe725 --- /dev/null +++ b/test/files/run/macro-def-infer-return-type/Impls_1.scala @@ -0,0 +1,14 @@ +import scala.reflect.macros.Context + +object Impls1 { + def foo(c: Context)(x: c.Expr[Int]) = x +} + +object Impls2 { + def foo[T](c: Context)(x: c.Expr[T]) = + throw new Error("an implementation is missing") +} + +object Impls3 { + def foo[T](c: Context)(x: c.Expr[T]): c.Expr[T] = x +} diff --git a/test/files/run/macro-def-infer-return-type/Macros_Test_2.scala b/test/files/run/macro-def-infer-return-type/Macros_Test_2.scala new file mode 100644 index 0000000000..f579586b7f --- /dev/null +++ b/test/files/run/macro-def-infer-return-type/Macros_Test_2.scala @@ -0,0 +1,24 @@ +object Macros1 { + def foo(x: Int) = macro Impls1.foo +} + +object Macros2 { + def foo[T](x: T) = macro Impls2.foo[T] +} + +object Macros3 { + def foo[T](x: T) = macro Impls3.foo[T] +} + +object Test extends App { + println(Macros1.foo(42)) + + import scala.reflect.runtime.universe._ + import scala.reflect.runtime.{currentMirror => cm} + import scala.tools.reflect.ToolBox + val tree = Apply(Select(Ident(TermName("Macros2")), TermName("foo")), List(Literal(Constant(42)))) + try cm.mkToolBox().eval(tree) + catch { case ex: Throwable => println(ex.getMessage) } + + println(Macros3.foo(42)) +} diff --git a/test/files/run/macro-def-path-dependent-a.flags b/test/files/run/macro-def-path-dependent-a.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-def-path-dependent-a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-b.check b/test/files/run/macro-def-path-dependent-b.check deleted file mode 100644 index 7658ad2c24..0000000000 --- a/test/files/run/macro-def-path-dependent-b.check +++ /dev/null @@ -1 +0,0 @@ -it works diff --git a/test/files/run/macro-def-path-dependent-b.flags b/test/files/run/macro-def-path-dependent-b.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-def-path-dependent-b.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-c.check b/test/files/run/macro-def-path-dependent-c.check deleted file mode 100644 index 7658ad2c24..0000000000 --- a/test/files/run/macro-def-path-dependent-c.check +++ /dev/null @@ -1 +0,0 @@ -it works diff --git a/test/files/run/macro-def-path-dependent-c.flags b/test/files/run/macro-def-path-dependent-c.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-def-path-dependent-c.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-d1.check b/test/files/run/macro-def-path-dependent-d1.check deleted file mode 100644 index 7658ad2c24..0000000000 --- a/test/files/run/macro-def-path-dependent-d1.check +++ /dev/null @@ -1 +0,0 @@ -it works diff --git a/test/files/run/macro-def-path-dependent-d1.flags b/test/files/run/macro-def-path-dependent-d1.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-def-path-dependent-d1.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-d1/Test_2.scala b/test/files/run/macro-def-path-dependent-d1/Test_2.scala deleted file mode 100644 index 7dffc5107d..0000000000 --- a/test/files/run/macro-def-path-dependent-d1/Test_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends App { - println("it works") -}
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-d2.check b/test/files/run/macro-def-path-dependent-d2.check deleted file mode 100644 index 7658ad2c24..0000000000 --- a/test/files/run/macro-def-path-dependent-d2.check +++ /dev/null @@ -1 +0,0 @@ -it works diff --git a/test/files/run/macro-def-path-dependent-d2.flags b/test/files/run/macro-def-path-dependent-d2.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-def-path-dependent-d2.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-d2/Test_3.scala b/test/files/run/macro-def-path-dependent-d2/Test_3.scala deleted file mode 100644 index 7dffc5107d..0000000000 --- a/test/files/run/macro-def-path-dependent-d2/Test_3.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends App { - println("it works") -}
\ No newline at end of file diff --git a/test/files/run/macro-declared-in-annotation.check b/test/files/run/macro-def-path-dependent.check index 7658ad2c24..7658ad2c24 100644 --- a/test/files/run/macro-declared-in-annotation.check +++ b/test/files/run/macro-def-path-dependent.check diff --git a/test/files/neg/macro-invalidret-nonuniversetree.flags b/test/files/run/macro-def-path-dependent.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidret-nonuniversetree.flags +++ b/test/files/run/macro-def-path-dependent.flags diff --git a/test/files/run/macro-def-path-dependent-a/Test_2.scala b/test/files/run/macro-def-path-dependent/Dummy.scala index 7dffc5107d..7dffc5107d 100644 --- a/test/files/run/macro-def-path-dependent-a/Test_2.scala +++ b/test/files/run/macro-def-path-dependent/Dummy.scala diff --git a/test/files/run/macro-def-path-dependent-a/Impls_Macros_1.scala b/test/files/run/macro-def-path-dependent/Test_1.scala index 3a91e41ff9..06c15e16c9 100644 --- a/test/files/run/macro-def-path-dependent-a/Impls_Macros_1.scala +++ b/test/files/run/macro-def-path-dependent/Test_1.scala @@ -1,3 +1,5 @@ +package test1 + import scala.reflect.macros.{Context => Ctx} trait Exprs { diff --git a/test/files/run/macro-def-path-dependent-b/Impls_Macros_1.scala b/test/files/run/macro-def-path-dependent/Test_2.scala index cf9f9ebd0e..f1e9909981 100644 --- a/test/files/run/macro-def-path-dependent-b/Impls_Macros_1.scala +++ b/test/files/run/macro-def-path-dependent/Test_2.scala @@ -1,3 +1,5 @@ +package test2 + import scala.reflect.macros.{Context => Ctx} trait Exprs { diff --git a/test/files/run/macro-def-path-dependent-c/Impls_Macros_1.scala b/test/files/run/macro-def-path-dependent/Test_3.scala index 6cb374d9ba..9f5efe5e47 100644 --- a/test/files/run/macro-def-path-dependent-c/Impls_Macros_1.scala +++ b/test/files/run/macro-def-path-dependent/Test_3.scala @@ -1,3 +1,5 @@ +package test3 + import scala.reflect.macros.{Context => Ctx} trait Exprs { diff --git a/test/files/run/macro-def-path-dependent-d1/Impls_Macros_1.scala b/test/files/run/macro-def-path-dependent/Test_4.scala index 69d9708b2a..3af920d739 100644 --- a/test/files/run/macro-def-path-dependent-d1/Impls_Macros_1.scala +++ b/test/files/run/macro-def-path-dependent/Test_4.scala @@ -1,3 +1,5 @@ +package test4 + import scala.reflect.runtime.universe._ import scala.reflect.macros.Context import scala.reflect.api.Universe diff --git a/test/files/run/macro-def-path-dependent-d2/Impls_1.scala b/test/files/run/macro-def-path-dependent/Test_5.scala index 7fa9c3579e..bc32fb92de 100644 --- a/test/files/run/macro-def-path-dependent-d2/Impls_1.scala +++ b/test/files/run/macro-def-path-dependent/Test_5.scala @@ -1,3 +1,5 @@ +package test56 + import scala.reflect.runtime.universe._ import scala.reflect.macros.Context import scala.reflect.api.Universe diff --git a/test/files/run/macro-def-path-dependent-d2/Macros_2.scala b/test/files/run/macro-def-path-dependent/Test_6.scala index 65ce4d8bd2..6267743473 100644 --- a/test/files/run/macro-def-path-dependent-d2/Macros_2.scala +++ b/test/files/run/macro-def-path-dependent/Test_6.scala @@ -1,3 +1,5 @@ +package test56 + import scala.reflect.runtime.universe._ import scala.reflect.macros.Context import scala.reflect.api.Universe diff --git a/test/files/run/macro-expand-nullary-generic.check b/test/files/run/macro-expand-nullary-generic.check index 42976f4baf..0470d239dc 100644 --- a/test/files/run/macro-expand-nullary-generic.check +++ b/test/files/run/macro-expand-nullary-generic.check @@ -1,6 +1,6 @@ -it works WeakTypeTag[Int] -it works WeakTypeTag[Int] -it works WeakTypeTag[Int] -it works WeakTypeTag[Int] -it works WeakTypeTag[Int] +fooNullary[Int] +fooEmpty[Int] +fooEmpty[Int] +barNullary[Int] +barEmpty[Int] kkthxbai diff --git a/test/files/run/macro-expand-nullary-generic/Impls_1.scala b/test/files/run/macro-expand-nullary-generic/Impls_1.scala index 39a9db0e14..5dfdd5c539 100644 --- a/test/files/run/macro-expand-nullary-generic/Impls_1.scala +++ b/test/files/run/macro-expand-nullary-generic/Impls_1.scala @@ -2,14 +2,14 @@ import scala.reflect.runtime.universe._ import scala.reflect.macros.{Context => Ctx} object Impls { - def impl[T: c.WeakTypeTag](c: Ctx) = { + def impl[T: c.WeakTypeTag](c: Ctx)(meth: String) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works " + implicitly[c.WeakTypeTag[T]])))) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(s"$meth[${c.weakTypeOf[T]}]")))) c.Expr[Unit](body) } - def fooNullary[T: c.WeakTypeTag](c: Ctx) = impl[T](c) - def fooEmpty[T: c.WeakTypeTag](c: Ctx)() = impl[T](c) - def barNullary[T: c.WeakTypeTag](c: Ctx)(x: c.Expr[Int]) = impl[T](c) - def barEmpty[T: c.WeakTypeTag](c: Ctx)(x: c.Expr[Int])() = impl[T](c) + def fooNullary[T: c.WeakTypeTag](c: Ctx) = impl[T](c)("fooNullary") + def fooEmpty[T: c.WeakTypeTag](c: Ctx)() = impl[T](c)("fooEmpty") + def barNullary[T: c.WeakTypeTag](c: Ctx)(x: c.Expr[Int]) = impl[T](c)("barNullary") + def barEmpty[T: c.WeakTypeTag](c: Ctx)(x: c.Expr[Int])() = impl[T](c)("barEmpty") }
\ No newline at end of file diff --git a/test/files/run/macro-expand-nullary-nongeneric.check b/test/files/run/macro-expand-nullary-nongeneric.check index 9ab5f3a2bc..cb7e766394 100644 --- a/test/files/run/macro-expand-nullary-nongeneric.check +++ b/test/files/run/macro-expand-nullary-nongeneric.check @@ -1,6 +1,6 @@ -it works -it works -it works -it works -it works +fooNullary +fooEmpty +fooEmpty +barNullary +barEmpty kkthxbai diff --git a/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala b/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala index 41e50acc86..d23c671c84 100644 --- a/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala +++ b/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala @@ -1,14 +1,15 @@ +import scala.reflect.runtime.universe._ import scala.reflect.macros.{Context => Ctx} object Impls { - def impl(c: Ctx) = { + def impl(c: Ctx)(meth: String) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works")))) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(meth)))) c.Expr[Unit](body) } - def fooNullary(c: Ctx) = impl(c) - def fooEmpty(c: Ctx)() = impl(c) - def barNullary(c: Ctx)(x: c.Expr[Int]) = impl(c) - def barEmpty(c: Ctx)(x: c.Expr[Int])() = impl(c) + def fooNullary(c: Ctx) = impl(c)("fooNullary") + def fooEmpty(c: Ctx)() = impl(c)("fooEmpty") + def barNullary(c: Ctx)(x: c.Expr[Int]) = impl(c)("barNullary") + def barEmpty(c: Ctx)(x: c.Expr[Int])() = impl(c)("barEmpty") }
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-bounds-a.flags b/test/files/run/macro-expand-tparams-bounds-a.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-expand-tparams-bounds-a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-bounds-a/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-bounds-a/Macros_Test_2.scala deleted file mode 100644 index b498e6f65b..0000000000 --- a/test/files/run/macro-expand-tparams-bounds-a/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo[U <: String] = macro Impls.foo[U] -} - -object Test extends App { - import Macros._ - foo[String] -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-bounds-b.flags b/test/files/run/macro-expand-tparams-bounds-b.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-expand-tparams-bounds-b.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-bounds-b/Impls_1.scala b/test/files/run/macro-expand-tparams-bounds-b/Impls_1.scala deleted file mode 100644 index c11c89151c..0000000000 --- a/test/files/run/macro-expand-tparams-bounds-b/Impls_1.scala +++ /dev/null @@ -1,7 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -class C - -object Impls { - def foo[U <: C](c: Ctx): c.Expr[Unit] = c.literalUnit -} diff --git a/test/files/run/macro-expand-tparams-bounds-b/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-bounds-b/Macros_Test_2.scala deleted file mode 100644 index 1a261e9f73..0000000000 --- a/test/files/run/macro-expand-tparams-bounds-b/Macros_Test_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -class D extends C - -object Macros { - def foo[T <: D] = macro Impls.foo[T] -} - -object Test extends App { - import Macros._ - foo[D] -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-bounds-b.check b/test/files/run/macro-expand-tparams-bounds.check index e69de29bb2..e69de29bb2 100644 --- a/test/files/run/macro-expand-tparams-bounds-b.check +++ b/test/files/run/macro-expand-tparams-bounds.check diff --git a/test/files/neg/macro-invalidshape-a.flags b/test/files/run/macro-expand-tparams-bounds.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidshape-a.flags +++ b/test/files/run/macro-expand-tparams-bounds.flags diff --git a/test/files/run/macro-expand-tparams-bounds/Impls_1.scala b/test/files/run/macro-expand-tparams-bounds/Impls_1.scala new file mode 100644 index 0000000000..f9103aaf8f --- /dev/null +++ b/test/files/run/macro-expand-tparams-bounds/Impls_1.scala @@ -0,0 +1,12 @@ +import scala.reflect.macros.Context + +object Impls1 { + def foo[U <: String](c: Context): c.Expr[Unit] = c.literalUnit +} + +class C +class D extends C + +object Impls2 { + def foo[U <: C](c: Context): c.Expr[Unit] = c.literalUnit +} diff --git a/test/files/run/macro-expand-tparams-bounds/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-bounds/Macros_Test_2.scala new file mode 100644 index 0000000000..37a4bcb2b9 --- /dev/null +++ b/test/files/run/macro-expand-tparams-bounds/Macros_Test_2.scala @@ -0,0 +1,12 @@ +object Macros1 { + def foo[U <: String] = macro Impls1.foo[U] +} + +object Macros2 { + def foo[T <: D] = macro Impls2.foo[T] +} + +object Test extends App { + Macros1.foo[String] + Macros2.foo[D] +} diff --git a/test/files/run/macro-expand-tparams-only-in-impl.flags b/test/files/run/macro-expand-tparams-only-in-impl.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-expand-tparams-only-in-impl.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-only-in-impl/Impls_1.scala b/test/files/run/macro-expand-tparams-only-in-impl/Impls_1.scala deleted file mode 100644 index 9b8dafaa97..0000000000 --- a/test/files/run/macro-expand-tparams-only-in-impl/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[U <: String](c: Ctx): c.Expr[Unit] = c.literalUnit -} diff --git a/test/files/run/macro-expand-tparams-only-in-impl/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-only-in-impl/Macros_Test_2.scala deleted file mode 100644 index 218c7aec7f..0000000000 --- a/test/files/run/macro-expand-tparams-only-in-impl/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Macros { - def foo = macro Impls.foo[String] -} - -object Test extends App { - import Macros._ - foo -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-optional.flags b/test/files/run/macro-expand-tparams-optional.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-expand-tparams-optional.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-a.check b/test/files/run/macro-expand-tparams-prefix-a.check deleted file mode 100644 index ca44a4f652..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-a.check +++ /dev/null @@ -1,4 +0,0 @@ -WeakTypeTag[Int] -WeakTypeTag[Int] -WeakTypeTag[String] -WeakTypeTag[Boolean] diff --git a/test/files/run/macro-expand-tparams-prefix-a.flags b/test/files/run/macro-expand-tparams-prefix-a.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala deleted file mode 100644 index c729aada51..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[U: c.WeakTypeTag](c: Ctx)(x: c.Expr[U]) = { - import c.universe._ - val U = implicitly[c.WeakTypeTag[U]] - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString)))) - c.Expr[Unit](body) - } -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-a/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-prefix-a/Macros_Test_2.scala deleted file mode 100644 index 81ccb7ff42..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-a/Macros_Test_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -object Test extends App { - class C[T] { - def foo[U](x: U) = macro Impls.foo[U] - } - - new C[Int]().foo(42) - new C[Boolean]().foo(42) - new C[Int]().foo("42") - new C[String]().foo(true) -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-b.check b/test/files/run/macro-expand-tparams-prefix-b.check deleted file mode 100644 index 2ff2ce435d..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-b.check +++ /dev/null @@ -1,2 +0,0 @@ -WeakTypeTag[Boolean] WeakTypeTag[Int] -WeakTypeTag[Boolean] WeakTypeTag[String] diff --git a/test/files/run/macro-expand-tparams-prefix-b.flags b/test/files/run/macro-expand-tparams-prefix-b.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-b.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala deleted file mode 100644 index 8880d13b04..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[T: c.WeakTypeTag, U: c.WeakTypeTag](c: Ctx)(x: c.Expr[U]) = { - import c.universe._ - val T = implicitly[c.WeakTypeTag[T]] - val U = implicitly[c.WeakTypeTag[U]] - val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString + " " + U.toString)))) - c.Expr[Unit](body) - } -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-b/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-prefix-b/Macros_Test_2.scala deleted file mode 100644 index a4a0acfe8b..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-b/Macros_Test_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -object Test extends App { - class C[T] { - def foo[U](x: U) = macro Impls.foo[T, U] - } - - object D extends C[Boolean] - - D.foo(42) - D.foo("42") -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-c1.check b/test/files/run/macro-expand-tparams-prefix-c1.check deleted file mode 100644 index 0f24f74db1..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-c1.check +++ /dev/null @@ -1,3 +0,0 @@ -WeakTypeTag[Int] -WeakTypeTag[String] -WeakTypeTag[Boolean] diff --git a/test/files/run/macro-expand-tparams-prefix-c1.flags b/test/files/run/macro-expand-tparams-prefix-c1.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-c1.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala deleted file mode 100644 index 2df42e969f..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { - import c.universe._ - c.Expr(Block(List( - Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), - Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), - Literal(Constant(())))) - } -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-c1/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-prefix-c1/Macros_Test_2.scala deleted file mode 100644 index 4fa0c8cb33..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-c1/Macros_Test_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -class D[T] { - class C[U] { - def foo[V] = macro Impls.foo[T, U, V] - } -} - -object Test extends App { - val outer1 = new D[Int] - val outer2 = new outer1.C[String] - outer2.foo[Boolean] -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-c2.check b/test/files/run/macro-expand-tparams-prefix-c2.check deleted file mode 100644 index 0f24f74db1..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-c2.check +++ /dev/null @@ -1,3 +0,0 @@ -WeakTypeTag[Int] -WeakTypeTag[String] -WeakTypeTag[Boolean] diff --git a/test/files/run/macro-expand-tparams-prefix-c2.flags b/test/files/run/macro-expand-tparams-prefix-c2.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-c2.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala b/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala deleted file mode 100644 index 08817708d4..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { - import c.universe._ - c.Expr(Block(List( - Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), - Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), - Literal(Constant(())))) - } -} - -class D[T] { - class C[U] { - def foo[V] = macro Impls.foo[T, U, V] - } -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-c2/Test_2.scala b/test/files/run/macro-expand-tparams-prefix-c2/Test_2.scala deleted file mode 100644 index e729d4a536..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-c2/Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends App { - val outer1 = new D[Int] - val outer2 = new outer1.C[String] - outer2.foo[Boolean] -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-d1.check b/test/files/run/macro-expand-tparams-prefix-d1.check deleted file mode 100644 index 7832503256..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-d1.check +++ /dev/null @@ -1,3 +0,0 @@ -WeakTypeTag[T] -WeakTypeTag[U] -WeakTypeTag[Boolean] diff --git a/test/files/run/macro-expand-tparams-prefix-d1.flags b/test/files/run/macro-expand-tparams-prefix-d1.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-d1.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala deleted file mode 100644 index 2df42e969f..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.macros.{Context => Ctx} - -object Impls { - def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { - import c.universe._ - c.Expr(Block(List( - Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), - Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), - Literal(Constant(())))) - } -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-d1/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-prefix-d1/Macros_Test_2.scala deleted file mode 100644 index 8222a6d1e8..0000000000 --- a/test/files/run/macro-expand-tparams-prefix-d1/Macros_Test_2.scala +++ /dev/null @@ -1,11 +0,0 @@ -object Test extends App { - class D[T] { - class C[U] { - def foo[V] = macro Impls.foo[T, U, V] - foo[Boolean] - } - } - - val outer1 = new D[Int] - new outer1.C[String] -}
\ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix.check b/test/files/run/macro-expand-tparams-prefix.check new file mode 100644 index 0000000000..7397958066 --- /dev/null +++ b/test/files/run/macro-expand-tparams-prefix.check @@ -0,0 +1,20 @@ +===Macros1=== +WeakTypeTag[Int] +WeakTypeTag[Int] +WeakTypeTag[String] +WeakTypeTag[Boolean] +===Macros2=== +WeakTypeTag[Boolean] WeakTypeTag[Int] +WeakTypeTag[Boolean] WeakTypeTag[String] +===Macros3=== +WeakTypeTag[Int] +WeakTypeTag[String] +WeakTypeTag[Boolean] +===Macros4=== +WeakTypeTag[Int] +WeakTypeTag[String] +WeakTypeTag[Boolean] +===Macros5=== +WeakTypeTag[T] +WeakTypeTag[U] +WeakTypeTag[Boolean] diff --git a/test/files/neg/macro-invalidshape-b.flags b/test/files/run/macro-expand-tparams-prefix.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidshape-b.flags +++ b/test/files/run/macro-expand-tparams-prefix.flags diff --git a/test/files/run/macro-expand-tparams-prefix/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix/Impls_1.scala new file mode 100644 index 0000000000..e92396d1b4 --- /dev/null +++ b/test/files/run/macro-expand-tparams-prefix/Impls_1.scala @@ -0,0 +1,40 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.macros.Context + +object Impls1 { + def foo[U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = { + import c.universe._ + val U = implicitly[c.WeakTypeTag[U]] + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString)))) + c.Expr[Unit](body) + } +} + +object Impls2 { + def foo[T: c.WeakTypeTag, U: c.WeakTypeTag](c: Context)(x: c.Expr[U]) = { + import c.universe._ + val T = implicitly[c.WeakTypeTag[T]] + val U = implicitly[c.WeakTypeTag[U]] + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString + " " + U.toString)))) + c.Expr[Unit](body) + } +} + +object Impls345 { + def foo[T, U: c.WeakTypeTag, V](c: Context)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { + import c.universe._ + c.Expr(Block(List( + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), + Literal(Constant(())))) + } +} + +object Macros4 { + class D[T] { + class C[U] { + def foo[V] = macro Impls345.foo[T, U, V] + } + } +} diff --git a/test/files/run/macro-expand-tparams-prefix/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-prefix/Macros_Test_2.scala new file mode 100644 index 0000000000..2b1730d36e --- /dev/null +++ b/test/files/run/macro-expand-tparams-prefix/Macros_Test_2.scala @@ -0,0 +1,57 @@ +object Macros1 { + class C[T] { + def foo[U](x: U) = macro Impls1.foo[U] + } +} + +object Macros2 { + class C[T] { + def foo[U](x: U) = macro Impls2.foo[T, U] + } +} + +object Macros3 { + class D[T] { + class C[U] { + def foo[V] = macro Impls345.foo[T, U, V] + } + } +} + +// object Macros4 is declared in Impls_1.scala + +object Macros5 { + class D[T] { + class C[U] { + def foo[V] = macro Impls345.foo[T, U, V] + foo[Boolean] + } + } +} + +object Test extends App { + println("===Macros1===") + new Macros1.C[Int]().foo(42) + new Macros1.C[Boolean]().foo(42) + new Macros1.C[Int]().foo("42") + new Macros1.C[String]().foo(true) + + println("===Macros2===") + object D2 extends Macros2.C[Boolean] + D2.foo(42) + D2.foo("42") + + println("===Macros3===") + val outer31 = new Macros3.D[Int] + val outer32 = new outer31.C[String] + outer32.foo[Boolean] + + println("===Macros4===") + val outer41 = new Macros4.D[Int] + val outer42 = new outer41.C[String] + outer42.foo[Boolean] + + println("===Macros5===") + val outer1 = new Macros5.D[Int] + new outer1.C[String] +}
\ No newline at end of file diff --git a/test/files/run/macro-impl-relaxed.check b/test/files/run/macro-impl-relaxed.check new file mode 100644 index 0000000000..487b116534 --- /dev/null +++ b/test/files/run/macro-impl-relaxed.check @@ -0,0 +1,4 @@ +2 +2 +2 +2 diff --git a/test/files/run/macro-impl-relaxed/Macros_1.scala b/test/files/run/macro-impl-relaxed/Macros_1.scala new file mode 100644 index 0000000000..af62646b4e --- /dev/null +++ b/test/files/run/macro-impl-relaxed/Macros_1.scala @@ -0,0 +1,14 @@ +import language.experimental.macros +import scala.reflect.macros.Context + +object Macros { + def implUU(c: Context)(x: c.Tree): c.Tree = x + def implTU(c: Context)(x: c.Expr[Int]): c.Tree = x.tree + def implUT(c: Context)(x: c.Tree): c.Expr[Int] = c.Expr[Int](x) + def implTT(c: Context)(x: c.Expr[Int]): c.Expr[Int] = x + + def fooUU(x: Int): Int = macro implUU + def fooTU(x: Int): Int = macro implTU + def fooUT(x: Int): Int = macro implUT + def fooTT(x: Int): Int = macro implTT +}
\ No newline at end of file diff --git a/test/files/run/macro-impl-relaxed/Test_2.scala b/test/files/run/macro-impl-relaxed/Test_2.scala new file mode 100644 index 0000000000..2eaeef0fd0 --- /dev/null +++ b/test/files/run/macro-impl-relaxed/Test_2.scala @@ -0,0 +1,6 @@ +object Test extends App { + println(Macros.fooUU(2)) + println(Macros.fooTU(2)) + println(Macros.fooUT(2)) + println(Macros.fooTT(2)) +}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidshape-c.flags b/test/files/run/macro-impl-tparam-only-in-impl.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidshape-c.flags +++ b/test/files/run/macro-impl-tparam-only-in-impl.flags diff --git a/test/files/run/macro-expand-tparams-bounds-a/Impls_1.scala b/test/files/run/macro-impl-tparam-only-in-impl/Impls_1.scala index 9b8dafaa97..9b8dafaa97 100644 --- a/test/files/run/macro-expand-tparams-bounds-a/Impls_1.scala +++ b/test/files/run/macro-impl-tparam-only-in-impl/Impls_1.scala diff --git a/test/files/neg/macro-invalidimpl-h/Macros_Test_2.scala b/test/files/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala index 218c7aec7f..218c7aec7f 100644 --- a/test/files/neg/macro-invalidimpl-h/Macros_Test_2.scala +++ b/test/files/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala diff --git a/test/files/run/macro-expand-tparams-optional.check b/test/files/run/macro-impl-tparam-typetag-is-optional.check index b4a0f394c1..b4a0f394c1 100644 --- a/test/files/run/macro-expand-tparams-optional.check +++ b/test/files/run/macro-impl-tparam-typetag-is-optional.check diff --git a/test/files/neg/macro-invalidusage-badbounds-a.flags b/test/files/run/macro-impl-tparam-typetag-is-optional.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidusage-badbounds-a.flags +++ b/test/files/run/macro-impl-tparam-typetag-is-optional.flags diff --git a/test/files/run/macro-expand-tparams-optional/Impls_1.scala b/test/files/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala index ace7a6cd26..ace7a6cd26 100644 --- a/test/files/run/macro-expand-tparams-optional/Impls_1.scala +++ b/test/files/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala diff --git a/test/files/run/macro-expand-tparams-optional/Macros_Test_2.scala b/test/files/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala index e72c27881a..e72c27881a 100644 --- a/test/files/run/macro-expand-tparams-optional/Macros_Test_2.scala +++ b/test/files/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala diff --git a/test/files/run/macro-invalidusage-partialapplication-with-tparams.check b/test/files/run/macro-invalidusage-partialapplication-with-tparams.check index f1d5e925fa..326f3e08ca 100644 --- a/test/files/run/macro-invalidusage-partialapplication-with-tparams.check +++ b/test/files/run/macro-invalidusage-partialapplication-with-tparams.check @@ -1,3 +1,3 @@ reflective compilation has failed: -macros cannot be partially applied +too few argument lists for macro invocation diff --git a/test/files/run/macro-invalidusage-partialapplication.check b/test/files/run/macro-invalidusage-partialapplication.check index f1d5e925fa..326f3e08ca 100644 --- a/test/files/run/macro-invalidusage-partialapplication.check +++ b/test/files/run/macro-invalidusage-partialapplication.check @@ -1,3 +1,3 @@ reflective compilation has failed: -macros cannot be partially applied +too few argument lists for macro invocation diff --git a/test/files/run/macro-def-path-dependent-a.check b/test/files/run/macro-term-declared-in-annotation.check index 7658ad2c24..7658ad2c24 100644 --- a/test/files/run/macro-def-path-dependent-a.check +++ b/test/files/run/macro-term-declared-in-annotation.check diff --git a/test/files/run/macro-declared-in-annotation.flags b/test/files/run/macro-term-declared-in-annotation.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-annotation.flags +++ b/test/files/run/macro-term-declared-in-annotation.flags diff --git a/test/files/run/macro-declared-in-annotation/Impls_1.scala b/test/files/run/macro-term-declared-in-annotation/Impls_1.scala index 1ea06de679..1ea06de679 100644 --- a/test/files/run/macro-declared-in-annotation/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-annotation/Impls_1.scala diff --git a/test/files/run/macro-declared-in-annotation/Macros_2.scala b/test/files/run/macro-term-declared-in-annotation/Macros_2.scala index 40d71c62fb..40d71c62fb 100644 --- a/test/files/run/macro-declared-in-annotation/Macros_2.scala +++ b/test/files/run/macro-term-declared-in-annotation/Macros_2.scala diff --git a/test/files/run/macro-declared-in-annotation/Test_3.scala b/test/files/run/macro-term-declared-in-annotation/Test_3.scala index 866487f028..866487f028 100644 --- a/test/files/run/macro-declared-in-annotation/Test_3.scala +++ b/test/files/run/macro-term-declared-in-annotation/Test_3.scala diff --git a/test/files/run/macro-declared-in-anonymous.check b/test/files/run/macro-term-declared-in-anonymous.check index 09b8d015a6..09b8d015a6 100644 --- a/test/files/run/macro-declared-in-anonymous.check +++ b/test/files/run/macro-term-declared-in-anonymous.check diff --git a/test/files/run/macro-declared-in-anonymous.flags b/test/files/run/macro-term-declared-in-anonymous.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-anonymous.flags +++ b/test/files/run/macro-term-declared-in-anonymous.flags diff --git a/test/files/run/macro-declared-in-anonymous/Impls_1.scala b/test/files/run/macro-term-declared-in-anonymous/Impls_1.scala index 348f3420f2..348f3420f2 100644 --- a/test/files/run/macro-declared-in-anonymous/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-anonymous/Impls_1.scala diff --git a/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-anonymous/Macros_Test_2.scala index 88cd29ae4f..88cd29ae4f 100644 --- a/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-anonymous/Macros_Test_2.scala diff --git a/test/files/run/macro-declared-in-block.check b/test/files/run/macro-term-declared-in-block.check index 5e687db8bf..5e687db8bf 100644 --- a/test/files/run/macro-declared-in-block.check +++ b/test/files/run/macro-term-declared-in-block.check diff --git a/test/files/run/macro-declared-in-block.flags b/test/files/run/macro-term-declared-in-block.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-block.flags +++ b/test/files/run/macro-term-declared-in-block.flags diff --git a/test/files/run/macro-declared-in-block/Impls_1.scala b/test/files/run/macro-term-declared-in-block/Impls_1.scala index 348f3420f2..348f3420f2 100644 --- a/test/files/run/macro-declared-in-block/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-block/Impls_1.scala diff --git a/test/files/run/macro-declared-in-block/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-block/Macros_Test_2.scala index 69088e24bc..69088e24bc 100644 --- a/test/files/run/macro-declared-in-block/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-block/Macros_Test_2.scala diff --git a/test/files/run/macro-declared-in-class-class.check b/test/files/run/macro-term-declared-in-class-class.check index 47248d7af7..47248d7af7 100644 --- a/test/files/run/macro-declared-in-class-class.check +++ b/test/files/run/macro-term-declared-in-class-class.check diff --git a/test/files/run/macro-declared-in-class-class.flags b/test/files/run/macro-term-declared-in-class-class.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-class-class.flags +++ b/test/files/run/macro-term-declared-in-class-class.flags diff --git a/test/files/run/macro-declared-in-class-class/Impls_1.scala b/test/files/run/macro-term-declared-in-class-class/Impls_1.scala index 348f3420f2..348f3420f2 100644 --- a/test/files/run/macro-declared-in-class-class/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-class-class/Impls_1.scala diff --git a/test/files/run/macro-declared-in-class-class/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-class-class/Macros_Test_2.scala index 871857a97f..871857a97f 100644 --- a/test/files/run/macro-declared-in-class-class/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-class-class/Macros_Test_2.scala diff --git a/test/files/run/macro-declared-in-class-object.check b/test/files/run/macro-term-declared-in-class-object.check index 35af59e40f..35af59e40f 100644 --- a/test/files/run/macro-declared-in-class-object.check +++ b/test/files/run/macro-term-declared-in-class-object.check diff --git a/test/files/run/macro-declared-in-class-object.flags b/test/files/run/macro-term-declared-in-class-object.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-class-object.flags +++ b/test/files/run/macro-term-declared-in-class-object.flags diff --git a/test/files/run/macro-declared-in-class-object/Impls_1.scala b/test/files/run/macro-term-declared-in-class-object/Impls_1.scala index 348f3420f2..348f3420f2 100644 --- a/test/files/run/macro-declared-in-class-object/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-class-object/Impls_1.scala diff --git a/test/files/run/macro-declared-in-class-object/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-class-object/Macros_Test_2.scala index 994f9fe935..994f9fe935 100644 --- a/test/files/run/macro-declared-in-class-object/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-class-object/Macros_Test_2.scala diff --git a/test/files/run/macro-declared-in-class.check b/test/files/run/macro-term-declared-in-class.check index a1c1d7af8b..a1c1d7af8b 100644 --- a/test/files/run/macro-declared-in-class.check +++ b/test/files/run/macro-term-declared-in-class.check diff --git a/test/files/run/macro-declared-in-class.flags b/test/files/run/macro-term-declared-in-class.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-class.flags +++ b/test/files/run/macro-term-declared-in-class.flags diff --git a/test/files/run/macro-declared-in-class/Impls_1.scala b/test/files/run/macro-term-declared-in-class/Impls_1.scala index 348f3420f2..348f3420f2 100644 --- a/test/files/run/macro-declared-in-class/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-class/Impls_1.scala diff --git a/test/files/run/macro-declared-in-class/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-class/Macros_Test_2.scala index 1b9d13e775..1b9d13e775 100644 --- a/test/files/run/macro-declared-in-class/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-class/Macros_Test_2.scala diff --git a/test/files/run/macro-declared-in-default-param.check b/test/files/run/macro-term-declared-in-default-param.check index 6decd7aa4d..6decd7aa4d 100644 --- a/test/files/run/macro-declared-in-default-param.check +++ b/test/files/run/macro-term-declared-in-default-param.check diff --git a/test/files/run/macro-declared-in-default-param.flags b/test/files/run/macro-term-declared-in-default-param.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-default-param.flags +++ b/test/files/run/macro-term-declared-in-default-param.flags diff --git a/test/files/run/macro-declared-in-default-param/Impls_1.scala b/test/files/run/macro-term-declared-in-default-param/Impls_1.scala index 4380f40b04..4380f40b04 100644 --- a/test/files/run/macro-declared-in-default-param/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-default-param/Impls_1.scala diff --git a/test/files/run/macro-declared-in-default-param/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-default-param/Macros_Test_2.scala index 356029e63e..356029e63e 100644 --- a/test/files/run/macro-declared-in-default-param/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-default-param/Macros_Test_2.scala diff --git a/test/files/run/macro-declared-in-implicit-class.check b/test/files/run/macro-term-declared-in-implicit-class.check index 5dc968c08c..5dc968c08c 100644 --- a/test/files/run/macro-declared-in-implicit-class.check +++ b/test/files/run/macro-term-declared-in-implicit-class.check diff --git a/test/files/run/macro-declared-in-implicit-class.flags b/test/files/run/macro-term-declared-in-implicit-class.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-implicit-class.flags +++ b/test/files/run/macro-term-declared-in-implicit-class.flags diff --git a/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala b/test/files/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala index 4c009cc367..4c009cc367 100644 --- a/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala +++ b/test/files/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala diff --git a/test/files/run/macro-declared-in-implicit-class/Test_2.scala b/test/files/run/macro-term-declared-in-implicit-class/Test_2.scala index d0bc9cc38c..d0bc9cc38c 100644 --- a/test/files/run/macro-declared-in-implicit-class/Test_2.scala +++ b/test/files/run/macro-term-declared-in-implicit-class/Test_2.scala diff --git a/test/files/run/macro-declared-in-method.check b/test/files/run/macro-term-declared-in-method.check index 5e687db8bf..5e687db8bf 100644 --- a/test/files/run/macro-declared-in-method.check +++ b/test/files/run/macro-term-declared-in-method.check diff --git a/test/files/run/macro-declared-in-method.flags b/test/files/run/macro-term-declared-in-method.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-method.flags +++ b/test/files/run/macro-term-declared-in-method.flags diff --git a/test/files/run/macro-declared-in-method/Impls_1.scala b/test/files/run/macro-term-declared-in-method/Impls_1.scala index 348f3420f2..348f3420f2 100644 --- a/test/files/run/macro-declared-in-method/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-method/Impls_1.scala diff --git a/test/files/run/macro-declared-in-method/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-method/Macros_Test_2.scala index ed5c8b7c43..ed5c8b7c43 100644 --- a/test/files/run/macro-declared-in-method/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-method/Macros_Test_2.scala diff --git a/test/files/run/macro-declared-in-object-class.check b/test/files/run/macro-term-declared-in-object-class.check index 47248d7af7..47248d7af7 100644 --- a/test/files/run/macro-declared-in-object-class.check +++ b/test/files/run/macro-term-declared-in-object-class.check diff --git a/test/files/run/macro-declared-in-object-class.flags b/test/files/run/macro-term-declared-in-object-class.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-object-class.flags +++ b/test/files/run/macro-term-declared-in-object-class.flags diff --git a/test/files/run/macro-declared-in-object-class/Impls_1.scala b/test/files/run/macro-term-declared-in-object-class/Impls_1.scala index 348f3420f2..348f3420f2 100644 --- a/test/files/run/macro-declared-in-object-class/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-object-class/Impls_1.scala diff --git a/test/files/run/macro-declared-in-object-class/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-object-class/Macros_Test_2.scala index 204deed61c..204deed61c 100644 --- a/test/files/run/macro-declared-in-object-class/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-object-class/Macros_Test_2.scala diff --git a/test/files/run/macro-declared-in-object-object.check b/test/files/run/macro-term-declared-in-object-object.check index 35af59e40f..35af59e40f 100644 --- a/test/files/run/macro-declared-in-object-object.check +++ b/test/files/run/macro-term-declared-in-object-object.check diff --git a/test/files/run/macro-declared-in-object-object.flags b/test/files/run/macro-term-declared-in-object-object.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-object-object.flags +++ b/test/files/run/macro-term-declared-in-object-object.flags diff --git a/test/files/run/macro-declared-in-object-object/Impls_1.scala b/test/files/run/macro-term-declared-in-object-object/Impls_1.scala index 348f3420f2..348f3420f2 100644 --- a/test/files/run/macro-declared-in-object-object/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-object-object/Impls_1.scala diff --git a/test/files/run/macro-declared-in-object-object/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-object-object/Macros_Test_2.scala index e261a50f3d..e261a50f3d 100644 --- a/test/files/run/macro-declared-in-object-object/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-object-object/Macros_Test_2.scala diff --git a/test/files/run/macro-declared-in-object.check b/test/files/run/macro-term-declared-in-object.check index 4d955a96b1..4d955a96b1 100644 --- a/test/files/run/macro-declared-in-object.check +++ b/test/files/run/macro-term-declared-in-object.check diff --git a/test/files/run/macro-declared-in-object.flags b/test/files/run/macro-term-declared-in-object.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-object.flags +++ b/test/files/run/macro-term-declared-in-object.flags diff --git a/test/files/run/macro-declared-in-object/Impls_1.scala b/test/files/run/macro-term-declared-in-object/Impls_1.scala index 348f3420f2..348f3420f2 100644 --- a/test/files/run/macro-declared-in-object/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-object/Impls_1.scala diff --git a/test/files/run/macro-declared-in-object/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-object/Macros_Test_2.scala index a5a4862ba0..a5a4862ba0 100644 --- a/test/files/run/macro-declared-in-object/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-object/Macros_Test_2.scala diff --git a/test/files/run/macro-declared-in-package-object.check b/test/files/run/macro-term-declared-in-package-object.check index bc0069178d..bc0069178d 100644 --- a/test/files/run/macro-declared-in-package-object.check +++ b/test/files/run/macro-term-declared-in-package-object.check diff --git a/test/files/run/macro-declared-in-package-object.flags b/test/files/run/macro-term-declared-in-package-object.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-package-object.flags +++ b/test/files/run/macro-term-declared-in-package-object.flags diff --git a/test/files/run/macro-declared-in-package-object/Impls_1.scala b/test/files/run/macro-term-declared-in-package-object/Impls_1.scala index 348f3420f2..348f3420f2 100644 --- a/test/files/run/macro-declared-in-package-object/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-package-object/Impls_1.scala diff --git a/test/files/run/macro-declared-in-package-object/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-package-object/Macros_Test_2.scala index 54a5962e80..54a5962e80 100644 --- a/test/files/run/macro-declared-in-package-object/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-package-object/Macros_Test_2.scala diff --git a/test/files/run/macro-declared-in-refinement.check b/test/files/run/macro-term-declared-in-refinement.check index 09b8d015a6..09b8d015a6 100644 --- a/test/files/run/macro-declared-in-refinement.check +++ b/test/files/run/macro-term-declared-in-refinement.check diff --git a/test/files/run/macro-declared-in-refinement.flags b/test/files/run/macro-term-declared-in-refinement.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-refinement.flags +++ b/test/files/run/macro-term-declared-in-refinement.flags diff --git a/test/files/run/macro-declared-in-refinement/Impls_1.scala b/test/files/run/macro-term-declared-in-refinement/Impls_1.scala index 348f3420f2..348f3420f2 100644 --- a/test/files/run/macro-declared-in-refinement/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-refinement/Impls_1.scala diff --git a/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-refinement/Macros_Test_2.scala index ff9a66d58a..ff9a66d58a 100644 --- a/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-refinement/Macros_Test_2.scala diff --git a/test/files/run/macro-declared-in-trait.check b/test/files/run/macro-term-declared-in-trait.check index 0d70ac74f3..0d70ac74f3 100644 --- a/test/files/run/macro-declared-in-trait.check +++ b/test/files/run/macro-term-declared-in-trait.check diff --git a/test/files/run/macro-declared-in-trait.flags b/test/files/run/macro-term-declared-in-trait.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/run/macro-declared-in-trait.flags +++ b/test/files/run/macro-term-declared-in-trait.flags diff --git a/test/files/run/macro-declared-in-trait/Impls_1.scala b/test/files/run/macro-term-declared-in-trait/Impls_1.scala index 348f3420f2..348f3420f2 100644 --- a/test/files/run/macro-declared-in-trait/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-trait/Impls_1.scala diff --git a/test/files/run/macro-declared-in-trait/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-trait/Macros_Test_2.scala index f75906b636..f75906b636 100644 --- a/test/files/run/macro-declared-in-trait/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-trait/Macros_Test_2.scala diff --git a/test/files/run/macro-toplevel-companion-b/Test_2.scala b/test/files/run/macro-toplevel-companion-b/Test_2.scala index ca202d053f..4e766bde89 100644 --- a/test/files/run/macro-toplevel-companion-b/Test_2.scala +++ b/test/files/run/macro-toplevel-companion-b/Test_2.scala @@ -7,5 +7,5 @@ import Macros._ object Test extends App { val tb = cm.mkToolBox() try tb.compile(Select(Ident(TermName("Macros")), TermName("foo"))) - catch { case ToolBoxError(message, _) => println("""macroSynthetic-.*?\.scala""".r.replaceAllIn(message, "<synthetic file name>")) } + catch { case ToolBoxError(message, _) => println("""(Found in|and) .*?compileLateSynthetic-.*?\.scala""".r.replaceAllIn(message, m => m.group(1) + " <synthetic file name>")) } }
\ No newline at end of file diff --git a/test/files/run/macro-toplevel-companion-c.scala b/test/files/run/macro-toplevel-companion-c.scala index 0e99903158..c315f8b942 100644 --- a/test/files/run/macro-toplevel-companion-c.scala +++ b/test/files/run/macro-toplevel-companion-c.scala @@ -45,7 +45,7 @@ object Test extends DirectTest { log("Compiling Test_2...") if (compileTest()) log("Success!") else log("Failed...") } - println("""macroSynthetic-.*?\.scala""".r.replaceAllIn(baos.toString, "<synthetic file name>")) + println("""(Found in|and) .*?compileLateSynthetic-.*?\.scala""".r.replaceAllIn(baos.toString, m => m.group(1) + " <synthetic file name>")) System.setErr(prevErr) } }
\ No newline at end of file diff --git a/test/files/run/reify-repl-fail-gracefully.check b/test/files/run/reify-repl-fail-gracefully.check index 1b0f3f2162..18cfd5a7ef 100644 --- a/test/files/run/reify-repl-fail-gracefully.check +++ b/test/files/run/reify-repl-fail-gracefully.check @@ -12,7 +12,7 @@ import scala.reflect.runtime.universe._ scala> scala> reify -<console>:12: error: macros cannot be partially applied +<console>:12: error: too few argument lists for macro invocation reify ^ diff --git a/test/files/run/repl-term-macros.check b/test/files/run/repl-term-macros.check new file mode 100644 index 0000000000..eae489c294 --- /dev/null +++ b/test/files/run/repl-term-macros.check @@ -0,0 +1,44 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> + +scala> import scala.reflect.macros.Context +import scala.reflect.macros.Context + +scala> import language.experimental.macros +import language.experimental.macros + +scala> + +scala> def impl1(c: Context) = c.literalUnit +impl1: (c: scala.reflect.macros.Context)c.Expr[Unit] + +scala> def foo1 = macro impl1 +defined term macro foo1: Unit + +scala> foo1 + +scala> + +scala> def impl2(c: Context)() = c.literalUnit +impl2: (c: scala.reflect.macros.Context)()c.Expr[Unit] + +scala> def foo2() = macro impl2 +defined term macro foo2: ()Unit + +scala> foo2() + +scala> + +scala> def impl3(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = c.literalUnit +impl3: (c: scala.reflect.macros.Context)(x: c.Expr[Int])(y: c.Expr[Int])c.Expr[Unit] + +scala> def foo3(x: Int)(y: Int) = macro impl3 +defined term macro foo3: (x: Int)(y: Int)Unit + +scala> foo3(2)(3) + +scala> + +scala> diff --git a/test/files/run/repl-term-macros.scala b/test/files/run/repl-term-macros.scala new file mode 100644 index 0000000000..f826259be9 --- /dev/null +++ b/test/files/run/repl-term-macros.scala @@ -0,0 +1,20 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + import scala.reflect.macros.Context +import language.experimental.macros + +def impl1(c: Context) = c.literalUnit +def foo1 = macro impl1 +foo1 + +def impl2(c: Context)() = c.literalUnit +def foo2() = macro impl2 +foo2() + +def impl3(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = c.literalUnit +def foo3(x: Int)(y: Int) = macro impl3 +foo3(2)(3) + """ +}
\ No newline at end of file diff --git a/test/files/run/richs.check b/test/files/run/richs.check index a970a814b1..02a98b376d 100644 --- a/test/files/run/richs.check +++ b/test/files/run/richs.check @@ -1,3 +1,4 @@ +warning: there were 2 deprecation warning(s); re-run with -deprecation for details RichCharTest1: true diff --git a/test/files/run/stream_length.check b/test/files/run/stream_length.check index 9906de773c..d1068f3247 100644 --- a/test/files/run/stream_length.check +++ b/test/files/run/stream_length.check @@ -1 +1,6 @@ +#partest !avian Length: 970299 + +#partest avian +!!!TEST SKIPPED!!! +See SI-7600 for further information. diff --git a/test/files/run/stream_length.scala b/test/files/run/stream_length.scala index 2808fbc495..33929f4b57 100644 --- a/test/files/run/stream_length.scala +++ b/test/files/run/stream_length.scala @@ -10,6 +10,10 @@ object Test { } def main(args: Array[String]) { - println("Length: " + walk(3, "---").length) + if (scala.tools.partest.utils.Properties.isAvian) { + println("!!!TEST SKIPPED!!!") + println("See SI-7600 for further information.") + } else + println("Length: " + walk(3, "---").length) } } diff --git a/test/files/run/t2464/Annotated.java b/test/files/run/t2464/Annotated.java new file mode 100644 index 0000000000..d022f9852c --- /dev/null +++ b/test/files/run/t2464/Annotated.java @@ -0,0 +1,5 @@ +package test; + +@Connect(loadStyle = Connect.LoadStyle.EAGER) +public class Annotated { +} diff --git a/test/files/run/t2464/Connect.java b/test/files/run/t2464/Connect.java new file mode 100644 index 0000000000..59349f94c8 --- /dev/null +++ b/test/files/run/t2464/Connect.java @@ -0,0 +1,20 @@ +package test; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface Connect { + + LoadStyle loadStyle() default LoadStyle.EAGER; + + public enum LoadStyle { + EAGER, + DEFERRED, + LAZY + } +} diff --git a/test/files/run/t2464/Test.scala b/test/files/run/t2464/Test.scala new file mode 100644 index 0000000000..90e1a03c17 --- /dev/null +++ b/test/files/run/t2464/Test.scala @@ -0,0 +1,35 @@ +import scala.reflect.io.Streamable +import scala.tools.asm.{ClassWriter, ClassReader} +import scala.tools.asm.tree.ClassNode +import scala.tools.partest._ +import scala.tools.partest.BytecodeTest.modifyClassFile +import java.io.{FileOutputStream, FileInputStream, File} + +object Test extends DirectTest { + def code = ??? + + def compileCode(code: String) = { + val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(code) + } + + def app = """ + object O { + new test.Annotated + } + """ + + def show(): Unit = { + compileCode(app) + modifyClassFile(new File(testOutput.toFile, "test/Annotated.class")) { + (cn: ClassNode) => + // As investigated https://issues.scala-lang.org/browse/SI-2464?focusedCommentId=64521&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-64521 + // classfiles in the wild sometimes lack the required InnerClass attribute for nested enums that + // are referenced in an annotation. I don't know what compiler or bytecode processor leaves things + // that way, but this test makes sure we don't crash. + cn.innerClasses.clear() + cn + } + compileCode(app) + } +} diff --git a/test/files/run/t3425b/Base_1.scala b/test/files/run/t3425b/Base_1.scala index 02e108b320..5a660a89b2 100644 --- a/test/files/run/t3425b/Base_1.scala +++ b/test/files/run/t3425b/Base_1.scala @@ -9,7 +9,7 @@ class ABC extends A with B with C { private def reflected = ( Thread.currentThread.getStackTrace takeWhile (_.getMethodName != "main") - exists (_.toString contains "java.lang.reflect.") + exists (_.toString contains "sun.reflect.") ) lazy val y: PQ = new PQ(reflected) } diff --git a/test/files/run/t4294.scala b/test/files/run/t4294.scala index fafaf1d8ef..e15c716047 100644 --- a/test/files/run/t4294.scala +++ b/test/files/run/t4294.scala @@ -1,7 +1,12 @@ object Test { def main(args: Array[String]) { + // Skip test on Avian, see SI-7600 for further information + if (!scala.tools.partest.utils.Properties.isAvian) + run() + } + + def run(): Unit = { (Stream.from(1).collect{case x if x > 5000000 => x}: Stream[Int]) - assert((Stream from 1 take 10 collect { case x if x <= 3 => x*x }).sum == 14) } } diff --git a/test/files/run/t5313.scala b/test/files/run/t5313.scala index 7da8726a1f..febfd9c3ed 100644 --- a/test/files/run/t5313.scala +++ b/test/files/run/t5313.scala @@ -7,7 +7,7 @@ object Test extends IcodeTest { override def code = """class Foo { - def randomBoolean = util.Random.nextInt % 2 == 0 + def randomBoolean = scala.util.Random.nextInt % 2 == 0 def bar = { var kept1 = new Object val result = new java.lang.ref.WeakReference(kept1) diff --git a/test/files/run/t5603.scala b/test/files/run/t5603.scala index 8c8038a602..77c2775cc3 100644 --- a/test/files/run/t5603.scala +++ b/test/files/run/t5603.scala @@ -1,7 +1,7 @@ import scala.tools.partest._ import java.io._ import scala.tools.nsc._ -import scala.tools.nsc.util.CommandLineParser +import scala.tools.cmd.CommandLineParser import scala.tools.nsc.{Global, Settings, CompilerCommand} import scala.tools.nsc.reporters.ConsoleReporter diff --git a/test/files/run/t6308.check b/test/files/run/t6308.check new file mode 100644 index 0000000000..e2577db72a --- /dev/null +++ b/test/files/run/t6308.check @@ -0,0 +1,16 @@ +- Unspecialized type args +// Specialized +f1 f1$mIc$sp +f2 f2$mIc$sp +f3 f3$mIc$sp +f4 f4$mIc$sp +f5 f5$mIc$sp + +// Unspecialized type args +f4(Boolean) f4 +f4(String) f4 + +// Ideally these would be specialized +todo1 todo1 +todo2 todo2 +todo3 todo3 diff --git a/test/files/run/t6308.scala b/test/files/run/t6308.scala new file mode 100644 index 0000000000..d23cd6e13e --- /dev/null +++ b/test/files/run/t6308.scala @@ -0,0 +1,45 @@ +import scala.{specialized => sp} + +// NOTE: `{ val c = caller; print(""); c }` is used instead of a simple `caller`, +// because we want to prevent tail-call optimization from eliding the stack- +// frames we want to inspect. + +object Test { + def caller = new Exception().getStackTrace()(1).getMethodName + def f1[@sp(Int) A](a: A, b: Any) = { val c = caller; print(""); c } + def f2[@sp(Int) A, B](a: A, b: String) = { val c = caller; print(""); c } + def f3[B, @sp(Int) A](a: A, b: List[B]) = { val c = caller; print(""); c } + def f4[B, @sp(Int) A](a: A, b: List[(A, B)]) = { val c = caller; print(""); c } + + def f5[@sp(Int) A, B <: Object](a: A, b: B) = { val c = caller; print(""); c } + + // `uncurryTreeType` calls a TypeMap on the call to this method and we end up with new + // type parameter symbols, which are not found in `TypeEnv.includes(typeEnv(member), env)` + // in `specSym`. (One of `uncurry`'s tasks is to expand type aliases in signatures.) + type T = Object + def todo1[@sp(Int) A, B <: T](a: A, b: String) = { val c = caller; print(""); c } + def todo2[@sp(Int) A, B <: AnyRef](a: A, b: String) = { val c = caller; print(""); c } + def todo3[B <: List[A], @specialized(Int) A](a: A, b: B) = { val c = caller; print(""); c } + + def main(args: Array[String]) { + val s = "" + val result = + s"""|- Unspecialized type args + |// Specialized + |f1 ${f1(1,"some ref")} + |f2 ${f2(1,"some ref")} + |f3 ${f3(1,List("some ref"))} + |f4 ${f4(1,Nil)} + |f5 ${f5(1,s)} + | + |// Unspecialized type args + |f4(Boolean) ${f4(Boolean,Nil)} + |f4(String) ${f4("",Nil)} + | + |// Ideally these would be specialized + |todo1 ${todo1(1,s)} + |todo2 ${todo2(1,s)} + |todo3 ${todo3(1,List(0))}""".stripMargin + println(result) + } +} diff --git a/test/files/run/t6331.scala b/test/files/run/t6331.scala index 4e43a7686e..5ac627a8ea 100644 --- a/test/files/run/t6331.scala +++ b/test/files/run/t6331.scala @@ -1,7 +1,7 @@ import scala.tools.partest._ import java.io._ import scala.tools.nsc._ -import scala.tools.nsc.util.CommandLineParser +import scala.tools.cmd.CommandLineParser import scala.tools.nsc.{Global, Settings, CompilerCommand} import scala.tools.nsc.reporters.ConsoleReporter diff --git a/test/files/run/t6331b.scala b/test/files/run/t6331b.scala index f966abea51..c567455c5c 100644 --- a/test/files/run/t6331b.scala +++ b/test/files/run/t6331b.scala @@ -1,7 +1,7 @@ import scala.tools.partest._ import java.io._ import scala.tools.nsc._ -import scala.tools.nsc.util.CommandLineParser +import scala.tools.cmd.CommandLineParser import scala.tools.nsc.{Global, Settings, CompilerCommand} import scala.tools.nsc.reporters.ConsoleReporter diff --git a/test/files/run/t6481.check b/test/files/run/t6481.check new file mode 100644 index 0000000000..7ec29631b1 --- /dev/null +++ b/test/files/run/t6481.check @@ -0,0 +1,4 @@ +delayed init +new foo(1, 2) +delayed init +new foo(b = 2, a = 1) diff --git a/test/files/run/t6481.scala b/test/files/run/t6481.scala new file mode 100644 index 0000000000..125da3b15a --- /dev/null +++ b/test/files/run/t6481.scala @@ -0,0 +1,13 @@ +abstract class foo(a: Int, b: Int) extends scala.DelayedInit { + def delayedInit(x: => Unit) { + println("delayed init"); + x + } +} + +object Test { + def main(args: Array[String]) { + new foo(1, 2) { println("new foo(1, 2)") } + new foo(b = 2, a = 1) { println("new foo(b = 2, a = 1)") } + } +} diff --git a/test/files/run/t7151.check b/test/files/run/t7151.check new file mode 100644 index 0000000000..d532d9589f --- /dev/null +++ b/test/files/run/t7151.check @@ -0,0 +1,6 @@ +class Test$InnerObject$ isFinal = false +class Test$InnerCase isFinal = true +class Test$InnerNonCase isFinal = true +class TopLevelObject$ isFinal = true +class TopLevelCase isFinal = true +class TopLevelNonCase isFinal = true diff --git a/test/files/run/t7151.scala b/test/files/run/t7151.scala new file mode 100644 index 0000000000..f6492ba43c --- /dev/null +++ b/test/files/run/t7151.scala @@ -0,0 +1,24 @@ +import java.lang.reflect.Modifier.isFinal + +object Test { + object InnerObject + final case class InnerCase() + final class InnerNonCase() + + def main(args: Array[String]) { + def checkFinal(clazz: Class[_]) = + println(s"${clazz} isFinal = ${isFinal(clazz.getModifiers())}") + + checkFinal(InnerObject.getClass) + checkFinal(classOf[InnerCase]) + checkFinal(classOf[InnerNonCase]) + + checkFinal(TopLevelObject.getClass) + checkFinal(classOf[TopLevelCase]) + checkFinal(classOf[TopLevelNonCase]) + } +} + +object TopLevelObject +final case class TopLevelCase() +final case class TopLevelNonCase() diff --git a/test/files/run/t7157.check b/test/files/run/t7157.check new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/test/files/run/t7157.check @@ -0,0 +1 @@ +1 diff --git a/test/files/run/t7157/Impls_Macros_1.scala b/test/files/run/t7157/Impls_Macros_1.scala new file mode 100644 index 0000000000..ad3d96eb85 --- /dev/null +++ b/test/files/run/t7157/Impls_Macros_1.scala @@ -0,0 +1,15 @@ +import scala.reflect.macros.Context +import language.experimental.macros + +object Macros { + object AImpl { + def a(ctx: Context)(args: ctx.Expr[Any]*): ctx.Expr[Unit] = { + import ctx.universe._ + ctx.Expr[Unit](Apply(Ident(TermName("println")), List(Literal(Constant(1))))) + } + } + + implicit class A(context: StringContext) { + def a(args: Any*): Unit = macro AImpl.a + } +}
\ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl-c/Test_2.scala b/test/files/run/t7157/Test_2.scala index e75a8ba101..cceb5ca177 100644 --- a/test/files/neg/macro-invalidimpl-c/Test_2.scala +++ b/test/files/run/t7157/Test_2.scala @@ -1,3 +1,5 @@ +import Macros._ + object Test extends App { - new Macros().foo(42) + a"" }
\ No newline at end of file diff --git a/test/files/run/t7271.scala b/test/files/run/t7271.scala index cb43331a29..55c388b7f5 100644 --- a/test/files/run/t7271.scala +++ b/test/files/run/t7271.scala @@ -1,7 +1,7 @@ import scala.tools.partest._ import java.io._ import scala.tools.nsc._ -import scala.tools.nsc.util.CommandLineParser +import scala.tools.cmd.CommandLineParser import scala.tools.nsc.{Global, Settings, CompilerCommand} import scala.tools.nsc.reporters.ConsoleReporter import scala.reflect.internal.Positions diff --git a/test/files/run/t7337.scala b/test/files/run/t7337.scala index d878182ed0..9913f8ae45 100644 --- a/test/files/run/t7337.scala +++ b/test/files/run/t7337.scala @@ -1,6 +1,6 @@ import scala.tools.partest._ import scala.tools.nsc._ -import util.{CommandLineParser} +import scala.tools.cmd.CommandLineParser object Test extends DirectTest { override def code = "class C" diff --git a/test/files/run/t7375a.check b/test/files/run/t7375a.check new file mode 100644 index 0000000000..a0a15dfb2f --- /dev/null +++ b/test/files/run/t7375a.check @@ -0,0 +1,4 @@ +C1 +C2 +C1 +C2 diff --git a/test/files/run/t7375a.scala b/test/files/run/t7375a.scala new file mode 100644 index 0000000000..e46ad08f63 --- /dev/null +++ b/test/files/run/t7375a.scala @@ -0,0 +1,16 @@ +import scala.reflect.ClassTag + +class C1(val n: Int) extends AnyVal +class C2(val n: Int) extends AnyRef + +object Test { + type F1 = C1 + type F2 = C2 + + def main(args: Array[String]): Unit = { + println(implicitly[ClassTag[C1]]) + println(implicitly[ClassTag[C2]]) + println(implicitly[ClassTag[F1]]) + println(implicitly[ClassTag[F2]]) + } +} diff --git a/test/files/run/t7375b.check b/test/files/run/t7375b.check new file mode 100644 index 0000000000..d7578e28ba --- /dev/null +++ b/test/files/run/t7375b.check @@ -0,0 +1,4 @@ +Predef.this.classOf[C1] +Predef.this.classOf[C2] +Predef.this.classOf[C1] +Predef.this.classOf[C2] diff --git a/test/files/run/t7375b/Macros_1.scala b/test/files/run/t7375b/Macros_1.scala new file mode 100644 index 0000000000..70e79cc2b4 --- /dev/null +++ b/test/files/run/t7375b/Macros_1.scala @@ -0,0 +1,18 @@ +import language.experimental.macros +import scala.reflect.macros.Context + +class C1(val n: Int) extends AnyVal +class C2(val n: Int) extends AnyRef + +object Macros { + type F1 = C1 + type F2 = C2 + + def foo = macro impl + def impl(c: Context) = { + import c.universe._ + def test[T: c.TypeTag] = reify(println(c.literal(c.reifyRuntimeClass(c.typeOf[T]).toString).splice)).tree + def tests = Block(List(test[C1], test[C2], test[F1], test[F2]), Literal(Constant(()))) + c.Expr[Unit](tests) + } +}
\ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent-c/Test_2.scala b/test/files/run/t7375b/Test_2.scala index 7dffc5107d..acfddae942 100644 --- a/test/files/run/macro-def-path-dependent-c/Test_2.scala +++ b/test/files/run/t7375b/Test_2.scala @@ -1,3 +1,3 @@ object Test extends App { - println("it works") + Macros.foo }
\ No newline at end of file diff --git a/test/files/run/t7398.scala b/test/files/run/t7398.scala index e4090f7db3..dd59697b71 100644 --- a/test/files/run/t7398.scala +++ b/test/files/run/t7398.scala @@ -3,14 +3,11 @@ import scala.tools.partest._ object Test extends CompilerTest { import global._ - def javaVersion = scala.util.Properties.javaVersion - def isJavaEight = javaVersion startsWith "1.8" // This way we auto-pass on non-java8 since there's nothing to check - override lazy val units = { - val res: List[CompilationUnit] = if (isJavaEight) javaCompilationUnits(global)(defaultMethodSource) else Nil - val word = if (isJavaEight) "Attempting" else "Skipping" - log(s"$word java8-specific test under java version $javaVersion") - res + override lazy val units: List[CompilationUnit] = testUnderJavaAtLeast("1.8") { + javaCompilationUnits(global)(defaultMethodSource) + } otherwise { + Nil } private def defaultMethodSource = """ diff --git a/test/files/run/t7439.check b/test/files/run/t7439.check new file mode 100644 index 0000000000..9ea09f9c40 --- /dev/null +++ b/test/files/run/t7439.check @@ -0,0 +1,2 @@ +Recompiling after deleting t7439-run.obj/A_1.class +pos: NoPosition Class A_1 not found - continuing with a stub. WARNING diff --git a/test/files/run/t7439/A_1.java b/test/files/run/t7439/A_1.java new file mode 100644 index 0000000000..4accd95d57 --- /dev/null +++ b/test/files/run/t7439/A_1.java @@ -0,0 +1,3 @@ +public class A_1 { + +}
\ No newline at end of file diff --git a/test/files/run/t7439/B_1.java b/test/files/run/t7439/B_1.java new file mode 100644 index 0000000000..5dd3b93d6f --- /dev/null +++ b/test/files/run/t7439/B_1.java @@ -0,0 +1,3 @@ +public class B_1 { + public void b(A_1[] a) {} +} diff --git a/test/files/run/t7439/Test_2.scala b/test/files/run/t7439/Test_2.scala new file mode 100644 index 0000000000..3ebbcfe753 --- /dev/null +++ b/test/files/run/t7439/Test_2.scala @@ -0,0 +1,32 @@ +import scala.tools.partest._ +import java.io.File + +object Test extends StoreReporterDirectTest { + def code = ??? + + def compileCode(code: String) = { + val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(code) + } + + def C = """ + class C { + new B_1 + } + """ + + def show(): Unit = { + //compileCode(C) + assert(filteredInfos.isEmpty, filteredInfos) + + // blow away the entire package + val a1Class = new File(testOutput.path, "A_1.class") + assert(a1Class.exists) + assert(a1Class.delete()) + println(s"Recompiling after deleting $a1Class") + + // bad symbolic reference error expected (but no stack trace!) + compileCode(C) + println(storeReporter.infos.mkString("\n")) // Included a NullPointerException before. + } +} diff --git a/test/files/run/t7498.scala b/test/files/run/t7498.scala new file mode 100644 index 0000000000..1dbf0597e0 --- /dev/null +++ b/test/files/run/t7498.scala @@ -0,0 +1,20 @@ + + + + + + + +object Test extends App { + import scala.collection.concurrent.TrieMap + + class Collision(val idx: Int) { + override def hashCode = idx % 10 + } + + val tm = TrieMap[Collision, Unit]() + for (i <- 0 until 1000) tm(new Collision(i)) = () + + tm.par.foreach(kv => ()) +} + diff --git a/test/files/run/t7507.scala b/test/files/run/t7507.scala new file mode 100644 index 0000000000..6c1959ddac --- /dev/null +++ b/test/files/run/t7507.scala @@ -0,0 +1,31 @@ +trait Cake extends Slice + +// Minimization +trait Slice { self: Cake => // must have self type that extends `Slice` + private[this] val bippy = () // must be private[this] + locally(bippy) +} + +// Originally reported bug: +trait Cake1 extends Slice1 +trait Slice1 { self: Cake1 => + import java.lang.String // any import will do! + val Tuple2(x, y) = ((1, 2)) +} + + +// Nesting +trait Cake3 extends Outer.Slice3 + +// Minimization +object Outer { + private[this] val bippy = () + trait Slice3 { self: Cake3 => + locally(bippy) + } +} + +object Test extends App { + val s1 = new Cake1 {} + assert((s1.x, s1.y) == (1, 2), (s1.x, s1.y)) +} diff --git a/test/files/run/t7556.check b/test/files/run/t7556.check new file mode 100644 index 0000000000..3328708a6d --- /dev/null +++ b/test/files/run/t7556.check @@ -0,0 +1,2 @@ +class annotations: List(scala.reflect.ScalaLongSignature) +3001 decls via runtime reflection diff --git a/test/files/run/t7556/Test_2.scala b/test/files/run/t7556/Test_2.scala new file mode 100644 index 0000000000..31848738ef --- /dev/null +++ b/test/files/run/t7556/Test_2.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ + +object Test { + def main(args: Array[String]) { + val mc = new MegaClass + val anns = mc.getClass.getAnnotations.map(_.annotationType.getName).toList.sorted + println(s"class annotations: $anns") + val N = typeTag[MegaClass].tpe.declarations.size // was: error reading Scala signature of MegaClass: 65935 + println(s"$N decls via runtime reflection") + } +} diff --git a/test/files/run/t7556/mega-class_1.scala b/test/files/run/t7556/mega-class_1.scala new file mode 100644 index 0000000000..dcc9ba8bcd --- /dev/null +++ b/test/files/run/t7556/mega-class_1.scala @@ -0,0 +1,3002 @@ +class MegaClass { + def method0: Int = 0 + def method1: Int = 0 + def method2: Int = 0 + def method3: Int = 0 + def method4: Int = 0 + def method5: Int = 0 + def method6: Int = 0 + def method7: Int = 0 + def method8: Int = 0 + def method9: Int = 0 + def method10: Int = 0 + def method11: Int = 0 + def method12: Int = 0 + def method13: Int = 0 + def method14: Int = 0 + def method15: Int = 0 + def method16: Int = 0 + def method17: Int = 0 + def method18: Int = 0 + def method19: Int = 0 + def method20: Int = 0 + def method21: Int = 0 + def method22: Int = 0 + def method23: Int = 0 + def method24: Int = 0 + def method25: Int = 0 + def method26: Int = 0 + def method27: Int = 0 + def method28: Int = 0 + def method29: Int = 0 + def method30: Int = 0 + def method31: Int = 0 + def method32: Int = 0 + def method33: Int = 0 + def method34: Int = 0 + def method35: Int = 0 + def method36: Int = 0 + def method37: Int = 0 + def method38: Int = 0 + def method39: Int = 0 + def method40: Int = 0 + def method41: Int = 0 + def method42: Int = 0 + def method43: Int = 0 + def method44: Int = 0 + def method45: Int = 0 + def method46: Int = 0 + def method47: Int = 0 + def method48: Int = 0 + def method49: Int = 0 + def method50: Int = 0 + def method51: Int = 0 + def method52: Int = 0 + def method53: Int = 0 + def method54: Int = 0 + def method55: Int = 0 + def method56: Int = 0 + def method57: Int = 0 + def method58: Int = 0 + def method59: Int = 0 + def method60: Int = 0 + def method61: Int = 0 + def method62: Int = 0 + def method63: Int = 0 + def method64: Int = 0 + def method65: Int = 0 + def method66: Int = 0 + def method67: Int = 0 + def method68: Int = 0 + def method69: Int = 0 + def method70: Int = 0 + def method71: Int = 0 + def method72: Int = 0 + def method73: Int = 0 + def method74: Int = 0 + def method75: Int = 0 + def method76: Int = 0 + def method77: Int = 0 + def method78: Int = 0 + def method79: Int = 0 + def method80: Int = 0 + def method81: Int = 0 + def method82: Int = 0 + def method83: Int = 0 + def method84: Int = 0 + def method85: Int = 0 + def method86: Int = 0 + def method87: Int = 0 + def method88: Int = 0 + def method89: Int = 0 + def method90: Int = 0 + def method91: Int = 0 + def method92: Int = 0 + def method93: Int = 0 + def method94: Int = 0 + def method95: Int = 0 + def method96: Int = 0 + def method97: Int = 0 + def method98: Int = 0 + def method99: Int = 0 + def method100: Int = 0 + def method101: Int = 0 + def method102: Int = 0 + def method103: Int = 0 + def method104: Int = 0 + def method105: Int = 0 + def method106: Int = 0 + def method107: Int = 0 + def method108: Int = 0 + def method109: Int = 0 + def method110: Int = 0 + def method111: Int = 0 + def method112: Int = 0 + def method113: Int = 0 + def method114: Int = 0 + def method115: Int = 0 + def method116: Int = 0 + def method117: Int = 0 + def method118: Int = 0 + def method119: Int = 0 + def method120: Int = 0 + def method121: Int = 0 + def method122: Int = 0 + def method123: Int = 0 + def method124: Int = 0 + def method125: Int = 0 + def method126: Int = 0 + def method127: Int = 0 + def method128: Int = 0 + def method129: Int = 0 + def method130: Int = 0 + def method131: Int = 0 + def method132: Int = 0 + def method133: Int = 0 + def method134: Int = 0 + def method135: Int = 0 + def method136: Int = 0 + def method137: Int = 0 + def method138: Int = 0 + def method139: Int = 0 + def method140: Int = 0 + def method141: Int = 0 + def method142: Int = 0 + def method143: Int = 0 + def method144: Int = 0 + def method145: Int = 0 + def method146: Int = 0 + def method147: Int = 0 + def method148: Int = 0 + def method149: Int = 0 + def method150: Int = 0 + def method151: Int = 0 + def method152: Int = 0 + def method153: Int = 0 + def method154: Int = 0 + def method155: Int = 0 + def method156: Int = 0 + def method157: Int = 0 + def method158: Int = 0 + def method159: Int = 0 + def method160: Int = 0 + def method161: Int = 0 + def method162: Int = 0 + def method163: Int = 0 + def method164: Int = 0 + def method165: Int = 0 + def method166: Int = 0 + def method167: Int = 0 + def method168: Int = 0 + def method169: Int = 0 + def method170: Int = 0 + def method171: Int = 0 + def method172: Int = 0 + def method173: Int = 0 + def method174: Int = 0 + def method175: Int = 0 + def method176: Int = 0 + def method177: Int = 0 + def method178: Int = 0 + def method179: Int = 0 + def method180: Int = 0 + def method181: Int = 0 + def method182: Int = 0 + def method183: Int = 0 + def method184: Int = 0 + def method185: Int = 0 + def method186: Int = 0 + def method187: Int = 0 + def method188: Int = 0 + def method189: Int = 0 + def method190: Int = 0 + def method191: Int = 0 + def method192: Int = 0 + def method193: Int = 0 + def method194: Int = 0 + def method195: Int = 0 + def method196: Int = 0 + def method197: Int = 0 + def method198: Int = 0 + def method199: Int = 0 + def method200: Int = 0 + def method201: Int = 0 + def method202: Int = 0 + def method203: Int = 0 + def method204: Int = 0 + def method205: Int = 0 + def method206: Int = 0 + def method207: Int = 0 + def method208: Int = 0 + def method209: Int = 0 + def method210: Int = 0 + def method211: Int = 0 + def method212: Int = 0 + def method213: Int = 0 + def method214: Int = 0 + def method215: Int = 0 + def method216: Int = 0 + def method217: Int = 0 + def method218: Int = 0 + def method219: Int = 0 + def method220: Int = 0 + def method221: Int = 0 + def method222: Int = 0 + def method223: Int = 0 + def method224: Int = 0 + def method225: Int = 0 + def method226: Int = 0 + def method227: Int = 0 + def method228: Int = 0 + def method229: Int = 0 + def method230: Int = 0 + def method231: Int = 0 + def method232: Int = 0 + def method233: Int = 0 + def method234: Int = 0 + def method235: Int = 0 + def method236: Int = 0 + def method237: Int = 0 + def method238: Int = 0 + def method239: Int = 0 + def method240: Int = 0 + def method241: Int = 0 + def method242: Int = 0 + def method243: Int = 0 + def method244: Int = 0 + def method245: Int = 0 + def method246: Int = 0 + def method247: Int = 0 + def method248: Int = 0 + def method249: Int = 0 + def method250: Int = 0 + def method251: Int = 0 + def method252: Int = 0 + def method253: Int = 0 + def method254: Int = 0 + def method255: Int = 0 + def method256: Int = 0 + def method257: Int = 0 + def method258: Int = 0 + def method259: Int = 0 + def method260: Int = 0 + def method261: Int = 0 + def method262: Int = 0 + def method263: Int = 0 + def method264: Int = 0 + def method265: Int = 0 + def method266: Int = 0 + def method267: Int = 0 + def method268: Int = 0 + def method269: Int = 0 + def method270: Int = 0 + def method271: Int = 0 + def method272: Int = 0 + def method273: Int = 0 + def method274: Int = 0 + def method275: Int = 0 + def method276: Int = 0 + def method277: Int = 0 + def method278: Int = 0 + def method279: Int = 0 + def method280: Int = 0 + def method281: Int = 0 + def method282: Int = 0 + def method283: Int = 0 + def method284: Int = 0 + def method285: Int = 0 + def method286: Int = 0 + def method287: Int = 0 + def method288: Int = 0 + def method289: Int = 0 + def method290: Int = 0 + def method291: Int = 0 + def method292: Int = 0 + def method293: Int = 0 + def method294: Int = 0 + def method295: Int = 0 + def method296: Int = 0 + def method297: Int = 0 + def method298: Int = 0 + def method299: Int = 0 + def method300: Int = 0 + def method301: Int = 0 + def method302: Int = 0 + def method303: Int = 0 + def method304: Int = 0 + def method305: Int = 0 + def method306: Int = 0 + def method307: Int = 0 + def method308: Int = 0 + def method309: Int = 0 + def method310: Int = 0 + def method311: Int = 0 + def method312: Int = 0 + def method313: Int = 0 + def method314: Int = 0 + def method315: Int = 0 + def method316: Int = 0 + def method317: Int = 0 + def method318: Int = 0 + def method319: Int = 0 + def method320: Int = 0 + def method321: Int = 0 + def method322: Int = 0 + def method323: Int = 0 + def method324: Int = 0 + def method325: Int = 0 + def method326: Int = 0 + def method327: Int = 0 + def method328: Int = 0 + def method329: Int = 0 + def method330: Int = 0 + def method331: Int = 0 + def method332: Int = 0 + def method333: Int = 0 + def method334: Int = 0 + def method335: Int = 0 + def method336: Int = 0 + def method337: Int = 0 + def method338: Int = 0 + def method339: Int = 0 + def method340: Int = 0 + def method341: Int = 0 + def method342: Int = 0 + def method343: Int = 0 + def method344: Int = 0 + def method345: Int = 0 + def method346: Int = 0 + def method347: Int = 0 + def method348: Int = 0 + def method349: Int = 0 + def method350: Int = 0 + def method351: Int = 0 + def method352: Int = 0 + def method353: Int = 0 + def method354: Int = 0 + def method355: Int = 0 + def method356: Int = 0 + def method357: Int = 0 + def method358: Int = 0 + def method359: Int = 0 + def method360: Int = 0 + def method361: Int = 0 + def method362: Int = 0 + def method363: Int = 0 + def method364: Int = 0 + def method365: Int = 0 + def method366: Int = 0 + def method367: Int = 0 + def method368: Int = 0 + def method369: Int = 0 + def method370: Int = 0 + def method371: Int = 0 + def method372: Int = 0 + def method373: Int = 0 + def method374: Int = 0 + def method375: Int = 0 + def method376: Int = 0 + def method377: Int = 0 + def method378: Int = 0 + def method379: Int = 0 + def method380: Int = 0 + def method381: Int = 0 + def method382: Int = 0 + def method383: Int = 0 + def method384: Int = 0 + def method385: Int = 0 + def method386: Int = 0 + def method387: Int = 0 + def method388: Int = 0 + def method389: Int = 0 + def method390: Int = 0 + def method391: Int = 0 + def method392: Int = 0 + def method393: Int = 0 + def method394: Int = 0 + def method395: Int = 0 + def method396: Int = 0 + def method397: Int = 0 + def method398: Int = 0 + def method399: Int = 0 + def method400: Int = 0 + def method401: Int = 0 + def method402: Int = 0 + def method403: Int = 0 + def method404: Int = 0 + def method405: Int = 0 + def method406: Int = 0 + def method407: Int = 0 + def method408: Int = 0 + def method409: Int = 0 + def method410: Int = 0 + def method411: Int = 0 + def method412: Int = 0 + def method413: Int = 0 + def method414: Int = 0 + def method415: Int = 0 + def method416: Int = 0 + def method417: Int = 0 + def method418: Int = 0 + def method419: Int = 0 + def method420: Int = 0 + def method421: Int = 0 + def method422: Int = 0 + def method423: Int = 0 + def method424: Int = 0 + def method425: Int = 0 + def method426: Int = 0 + def method427: Int = 0 + def method428: Int = 0 + def method429: Int = 0 + def method430: Int = 0 + def method431: Int = 0 + def method432: Int = 0 + def method433: Int = 0 + def method434: Int = 0 + def method435: Int = 0 + def method436: Int = 0 + def method437: Int = 0 + def method438: Int = 0 + def method439: Int = 0 + def method440: Int = 0 + def method441: Int = 0 + def method442: Int = 0 + def method443: Int = 0 + def method444: Int = 0 + def method445: Int = 0 + def method446: Int = 0 + def method447: Int = 0 + def method448: Int = 0 + def method449: Int = 0 + def method450: Int = 0 + def method451: Int = 0 + def method452: Int = 0 + def method453: Int = 0 + def method454: Int = 0 + def method455: Int = 0 + def method456: Int = 0 + def method457: Int = 0 + def method458: Int = 0 + def method459: Int = 0 + def method460: Int = 0 + def method461: Int = 0 + def method462: Int = 0 + def method463: Int = 0 + def method464: Int = 0 + def method465: Int = 0 + def method466: Int = 0 + def method467: Int = 0 + def method468: Int = 0 + def method469: Int = 0 + def method470: Int = 0 + def method471: Int = 0 + def method472: Int = 0 + def method473: Int = 0 + def method474: Int = 0 + def method475: Int = 0 + def method476: Int = 0 + def method477: Int = 0 + def method478: Int = 0 + def method479: Int = 0 + def method480: Int = 0 + def method481: Int = 0 + def method482: Int = 0 + def method483: Int = 0 + def method484: Int = 0 + def method485: Int = 0 + def method486: Int = 0 + def method487: Int = 0 + def method488: Int = 0 + def method489: Int = 0 + def method490: Int = 0 + def method491: Int = 0 + def method492: Int = 0 + def method493: Int = 0 + def method494: Int = 0 + def method495: Int = 0 + def method496: Int = 0 + def method497: Int = 0 + def method498: Int = 0 + def method499: Int = 0 + def method500: Int = 0 + def method501: Int = 0 + def method502: Int = 0 + def method503: Int = 0 + def method504: Int = 0 + def method505: Int = 0 + def method506: Int = 0 + def method507: Int = 0 + def method508: Int = 0 + def method509: Int = 0 + def method510: Int = 0 + def method511: Int = 0 + def method512: Int = 0 + def method513: Int = 0 + def method514: Int = 0 + def method515: Int = 0 + def method516: Int = 0 + def method517: Int = 0 + def method518: Int = 0 + def method519: Int = 0 + def method520: Int = 0 + def method521: Int = 0 + def method522: Int = 0 + def method523: Int = 0 + def method524: Int = 0 + def method525: Int = 0 + def method526: Int = 0 + def method527: Int = 0 + def method528: Int = 0 + def method529: Int = 0 + def method530: Int = 0 + def method531: Int = 0 + def method532: Int = 0 + def method533: Int = 0 + def method534: Int = 0 + def method535: Int = 0 + def method536: Int = 0 + def method537: Int = 0 + def method538: Int = 0 + def method539: Int = 0 + def method540: Int = 0 + def method541: Int = 0 + def method542: Int = 0 + def method543: Int = 0 + def method544: Int = 0 + def method545: Int = 0 + def method546: Int = 0 + def method547: Int = 0 + def method548: Int = 0 + def method549: Int = 0 + def method550: Int = 0 + def method551: Int = 0 + def method552: Int = 0 + def method553: Int = 0 + def method554: Int = 0 + def method555: Int = 0 + def method556: Int = 0 + def method557: Int = 0 + def method558: Int = 0 + def method559: Int = 0 + def method560: Int = 0 + def method561: Int = 0 + def method562: Int = 0 + def method563: Int = 0 + def method564: Int = 0 + def method565: Int = 0 + def method566: Int = 0 + def method567: Int = 0 + def method568: Int = 0 + def method569: Int = 0 + def method570: Int = 0 + def method571: Int = 0 + def method572: Int = 0 + def method573: Int = 0 + def method574: Int = 0 + def method575: Int = 0 + def method576: Int = 0 + def method577: Int = 0 + def method578: Int = 0 + def method579: Int = 0 + def method580: Int = 0 + def method581: Int = 0 + def method582: Int = 0 + def method583: Int = 0 + def method584: Int = 0 + def method585: Int = 0 + def method586: Int = 0 + def method587: Int = 0 + def method588: Int = 0 + def method589: Int = 0 + def method590: Int = 0 + def method591: Int = 0 + def method592: Int = 0 + def method593: Int = 0 + def method594: Int = 0 + def method595: Int = 0 + def method596: Int = 0 + def method597: Int = 0 + def method598: Int = 0 + def method599: Int = 0 + def method600: Int = 0 + def method601: Int = 0 + def method602: Int = 0 + def method603: Int = 0 + def method604: Int = 0 + def method605: Int = 0 + def method606: Int = 0 + def method607: Int = 0 + def method608: Int = 0 + def method609: Int = 0 + def method610: Int = 0 + def method611: Int = 0 + def method612: Int = 0 + def method613: Int = 0 + def method614: Int = 0 + def method615: Int = 0 + def method616: Int = 0 + def method617: Int = 0 + def method618: Int = 0 + def method619: Int = 0 + def method620: Int = 0 + def method621: Int = 0 + def method622: Int = 0 + def method623: Int = 0 + def method624: Int = 0 + def method625: Int = 0 + def method626: Int = 0 + def method627: Int = 0 + def method628: Int = 0 + def method629: Int = 0 + def method630: Int = 0 + def method631: Int = 0 + def method632: Int = 0 + def method633: Int = 0 + def method634: Int = 0 + def method635: Int = 0 + def method636: Int = 0 + def method637: Int = 0 + def method638: Int = 0 + def method639: Int = 0 + def method640: Int = 0 + def method641: Int = 0 + def method642: Int = 0 + def method643: Int = 0 + def method644: Int = 0 + def method645: Int = 0 + def method646: Int = 0 + def method647: Int = 0 + def method648: Int = 0 + def method649: Int = 0 + def method650: Int = 0 + def method651: Int = 0 + def method652: Int = 0 + def method653: Int = 0 + def method654: Int = 0 + def method655: Int = 0 + def method656: Int = 0 + def method657: Int = 0 + def method658: Int = 0 + def method659: Int = 0 + def method660: Int = 0 + def method661: Int = 0 + def method662: Int = 0 + def method663: Int = 0 + def method664: Int = 0 + def method665: Int = 0 + def method666: Int = 0 + def method667: Int = 0 + def method668: Int = 0 + def method669: Int = 0 + def method670: Int = 0 + def method671: Int = 0 + def method672: Int = 0 + def method673: Int = 0 + def method674: Int = 0 + def method675: Int = 0 + def method676: Int = 0 + def method677: Int = 0 + def method678: Int = 0 + def method679: Int = 0 + def method680: Int = 0 + def method681: Int = 0 + def method682: Int = 0 + def method683: Int = 0 + def method684: Int = 0 + def method685: Int = 0 + def method686: Int = 0 + def method687: Int = 0 + def method688: Int = 0 + def method689: Int = 0 + def method690: Int = 0 + def method691: Int = 0 + def method692: Int = 0 + def method693: Int = 0 + def method694: Int = 0 + def method695: Int = 0 + def method696: Int = 0 + def method697: Int = 0 + def method698: Int = 0 + def method699: Int = 0 + def method700: Int = 0 + def method701: Int = 0 + def method702: Int = 0 + def method703: Int = 0 + def method704: Int = 0 + def method705: Int = 0 + def method706: Int = 0 + def method707: Int = 0 + def method708: Int = 0 + def method709: Int = 0 + def method710: Int = 0 + def method711: Int = 0 + def method712: Int = 0 + def method713: Int = 0 + def method714: Int = 0 + def method715: Int = 0 + def method716: Int = 0 + def method717: Int = 0 + def method718: Int = 0 + def method719: Int = 0 + def method720: Int = 0 + def method721: Int = 0 + def method722: Int = 0 + def method723: Int = 0 + def method724: Int = 0 + def method725: Int = 0 + def method726: Int = 0 + def method727: Int = 0 + def method728: Int = 0 + def method729: Int = 0 + def method730: Int = 0 + def method731: Int = 0 + def method732: Int = 0 + def method733: Int = 0 + def method734: Int = 0 + def method735: Int = 0 + def method736: Int = 0 + def method737: Int = 0 + def method738: Int = 0 + def method739: Int = 0 + def method740: Int = 0 + def method741: Int = 0 + def method742: Int = 0 + def method743: Int = 0 + def method744: Int = 0 + def method745: Int = 0 + def method746: Int = 0 + def method747: Int = 0 + def method748: Int = 0 + def method749: Int = 0 + def method750: Int = 0 + def method751: Int = 0 + def method752: Int = 0 + def method753: Int = 0 + def method754: Int = 0 + def method755: Int = 0 + def method756: Int = 0 + def method757: Int = 0 + def method758: Int = 0 + def method759: Int = 0 + def method760: Int = 0 + def method761: Int = 0 + def method762: Int = 0 + def method763: Int = 0 + def method764: Int = 0 + def method765: Int = 0 + def method766: Int = 0 + def method767: Int = 0 + def method768: Int = 0 + def method769: Int = 0 + def method770: Int = 0 + def method771: Int = 0 + def method772: Int = 0 + def method773: Int = 0 + def method774: Int = 0 + def method775: Int = 0 + def method776: Int = 0 + def method777: Int = 0 + def method778: Int = 0 + def method779: Int = 0 + def method780: Int = 0 + def method781: Int = 0 + def method782: Int = 0 + def method783: Int = 0 + def method784: Int = 0 + def method785: Int = 0 + def method786: Int = 0 + def method787: Int = 0 + def method788: Int = 0 + def method789: Int = 0 + def method790: Int = 0 + def method791: Int = 0 + def method792: Int = 0 + def method793: Int = 0 + def method794: Int = 0 + def method795: Int = 0 + def method796: Int = 0 + def method797: Int = 0 + def method798: Int = 0 + def method799: Int = 0 + def method800: Int = 0 + def method801: Int = 0 + def method802: Int = 0 + def method803: Int = 0 + def method804: Int = 0 + def method805: Int = 0 + def method806: Int = 0 + def method807: Int = 0 + def method808: Int = 0 + def method809: Int = 0 + def method810: Int = 0 + def method811: Int = 0 + def method812: Int = 0 + def method813: Int = 0 + def method814: Int = 0 + def method815: Int = 0 + def method816: Int = 0 + def method817: Int = 0 + def method818: Int = 0 + def method819: Int = 0 + def method820: Int = 0 + def method821: Int = 0 + def method822: Int = 0 + def method823: Int = 0 + def method824: Int = 0 + def method825: Int = 0 + def method826: Int = 0 + def method827: Int = 0 + def method828: Int = 0 + def method829: Int = 0 + def method830: Int = 0 + def method831: Int = 0 + def method832: Int = 0 + def method833: Int = 0 + def method834: Int = 0 + def method835: Int = 0 + def method836: Int = 0 + def method837: Int = 0 + def method838: Int = 0 + def method839: Int = 0 + def method840: Int = 0 + def method841: Int = 0 + def method842: Int = 0 + def method843: Int = 0 + def method844: Int = 0 + def method845: Int = 0 + def method846: Int = 0 + def method847: Int = 0 + def method848: Int = 0 + def method849: Int = 0 + def method850: Int = 0 + def method851: Int = 0 + def method852: Int = 0 + def method853: Int = 0 + def method854: Int = 0 + def method855: Int = 0 + def method856: Int = 0 + def method857: Int = 0 + def method858: Int = 0 + def method859: Int = 0 + def method860: Int = 0 + def method861: Int = 0 + def method862: Int = 0 + def method863: Int = 0 + def method864: Int = 0 + def method865: Int = 0 + def method866: Int = 0 + def method867: Int = 0 + def method868: Int = 0 + def method869: Int = 0 + def method870: Int = 0 + def method871: Int = 0 + def method872: Int = 0 + def method873: Int = 0 + def method874: Int = 0 + def method875: Int = 0 + def method876: Int = 0 + def method877: Int = 0 + def method878: Int = 0 + def method879: Int = 0 + def method880: Int = 0 + def method881: Int = 0 + def method882: Int = 0 + def method883: Int = 0 + def method884: Int = 0 + def method885: Int = 0 + def method886: Int = 0 + def method887: Int = 0 + def method888: Int = 0 + def method889: Int = 0 + def method890: Int = 0 + def method891: Int = 0 + def method892: Int = 0 + def method893: Int = 0 + def method894: Int = 0 + def method895: Int = 0 + def method896: Int = 0 + def method897: Int = 0 + def method898: Int = 0 + def method899: Int = 0 + def method900: Int = 0 + def method901: Int = 0 + def method902: Int = 0 + def method903: Int = 0 + def method904: Int = 0 + def method905: Int = 0 + def method906: Int = 0 + def method907: Int = 0 + def method908: Int = 0 + def method909: Int = 0 + def method910: Int = 0 + def method911: Int = 0 + def method912: Int = 0 + def method913: Int = 0 + def method914: Int = 0 + def method915: Int = 0 + def method916: Int = 0 + def method917: Int = 0 + def method918: Int = 0 + def method919: Int = 0 + def method920: Int = 0 + def method921: Int = 0 + def method922: Int = 0 + def method923: Int = 0 + def method924: Int = 0 + def method925: Int = 0 + def method926: Int = 0 + def method927: Int = 0 + def method928: Int = 0 + def method929: Int = 0 + def method930: Int = 0 + def method931: Int = 0 + def method932: Int = 0 + def method933: Int = 0 + def method934: Int = 0 + def method935: Int = 0 + def method936: Int = 0 + def method937: Int = 0 + def method938: Int = 0 + def method939: Int = 0 + def method940: Int = 0 + def method941: Int = 0 + def method942: Int = 0 + def method943: Int = 0 + def method944: Int = 0 + def method945: Int = 0 + def method946: Int = 0 + def method947: Int = 0 + def method948: Int = 0 + def method949: Int = 0 + def method950: Int = 0 + def method951: Int = 0 + def method952: Int = 0 + def method953: Int = 0 + def method954: Int = 0 + def method955: Int = 0 + def method956: Int = 0 + def method957: Int = 0 + def method958: Int = 0 + def method959: Int = 0 + def method960: Int = 0 + def method961: Int = 0 + def method962: Int = 0 + def method963: Int = 0 + def method964: Int = 0 + def method965: Int = 0 + def method966: Int = 0 + def method967: Int = 0 + def method968: Int = 0 + def method969: Int = 0 + def method970: Int = 0 + def method971: Int = 0 + def method972: Int = 0 + def method973: Int = 0 + def method974: Int = 0 + def method975: Int = 0 + def method976: Int = 0 + def method977: Int = 0 + def method978: Int = 0 + def method979: Int = 0 + def method980: Int = 0 + def method981: Int = 0 + def method982: Int = 0 + def method983: Int = 0 + def method984: Int = 0 + def method985: Int = 0 + def method986: Int = 0 + def method987: Int = 0 + def method988: Int = 0 + def method989: Int = 0 + def method990: Int = 0 + def method991: Int = 0 + def method992: Int = 0 + def method993: Int = 0 + def method994: Int = 0 + def method995: Int = 0 + def method996: Int = 0 + def method997: Int = 0 + def method998: Int = 0 + def method999: Int = 0 + def method1000: Int = 0 + def method1001: Int = 0 + def method1002: Int = 0 + def method1003: Int = 0 + def method1004: Int = 0 + def method1005: Int = 0 + def method1006: Int = 0 + def method1007: Int = 0 + def method1008: Int = 0 + def method1009: Int = 0 + def method1010: Int = 0 + def method1011: Int = 0 + def method1012: Int = 0 + def method1013: Int = 0 + def method1014: Int = 0 + def method1015: Int = 0 + def method1016: Int = 0 + def method1017: Int = 0 + def method1018: Int = 0 + def method1019: Int = 0 + def method1020: Int = 0 + def method1021: Int = 0 + def method1022: Int = 0 + def method1023: Int = 0 + def method1024: Int = 0 + def method1025: Int = 0 + def method1026: Int = 0 + def method1027: Int = 0 + def method1028: Int = 0 + def method1029: Int = 0 + def method1030: Int = 0 + def method1031: Int = 0 + def method1032: Int = 0 + def method1033: Int = 0 + def method1034: Int = 0 + def method1035: Int = 0 + def method1036: Int = 0 + def method1037: Int = 0 + def method1038: Int = 0 + def method1039: Int = 0 + def method1040: Int = 0 + def method1041: Int = 0 + def method1042: Int = 0 + def method1043: Int = 0 + def method1044: Int = 0 + def method1045: Int = 0 + def method1046: Int = 0 + def method1047: Int = 0 + def method1048: Int = 0 + def method1049: Int = 0 + def method1050: Int = 0 + def method1051: Int = 0 + def method1052: Int = 0 + def method1053: Int = 0 + def method1054: Int = 0 + def method1055: Int = 0 + def method1056: Int = 0 + def method1057: Int = 0 + def method1058: Int = 0 + def method1059: Int = 0 + def method1060: Int = 0 + def method1061: Int = 0 + def method1062: Int = 0 + def method1063: Int = 0 + def method1064: Int = 0 + def method1065: Int = 0 + def method1066: Int = 0 + def method1067: Int = 0 + def method1068: Int = 0 + def method1069: Int = 0 + def method1070: Int = 0 + def method1071: Int = 0 + def method1072: Int = 0 + def method1073: Int = 0 + def method1074: Int = 0 + def method1075: Int = 0 + def method1076: Int = 0 + def method1077: Int = 0 + def method1078: Int = 0 + def method1079: Int = 0 + def method1080: Int = 0 + def method1081: Int = 0 + def method1082: Int = 0 + def method1083: Int = 0 + def method1084: Int = 0 + def method1085: Int = 0 + def method1086: Int = 0 + def method1087: Int = 0 + def method1088: Int = 0 + def method1089: Int = 0 + def method1090: Int = 0 + def method1091: Int = 0 + def method1092: Int = 0 + def method1093: Int = 0 + def method1094: Int = 0 + def method1095: Int = 0 + def method1096: Int = 0 + def method1097: Int = 0 + def method1098: Int = 0 + def method1099: Int = 0 + def method1100: Int = 0 + def method1101: Int = 0 + def method1102: Int = 0 + def method1103: Int = 0 + def method1104: Int = 0 + def method1105: Int = 0 + def method1106: Int = 0 + def method1107: Int = 0 + def method1108: Int = 0 + def method1109: Int = 0 + def method1110: Int = 0 + def method1111: Int = 0 + def method1112: Int = 0 + def method1113: Int = 0 + def method1114: Int = 0 + def method1115: Int = 0 + def method1116: Int = 0 + def method1117: Int = 0 + def method1118: Int = 0 + def method1119: Int = 0 + def method1120: Int = 0 + def method1121: Int = 0 + def method1122: Int = 0 + def method1123: Int = 0 + def method1124: Int = 0 + def method1125: Int = 0 + def method1126: Int = 0 + def method1127: Int = 0 + def method1128: Int = 0 + def method1129: Int = 0 + def method1130: Int = 0 + def method1131: Int = 0 + def method1132: Int = 0 + def method1133: Int = 0 + def method1134: Int = 0 + def method1135: Int = 0 + def method1136: Int = 0 + def method1137: Int = 0 + def method1138: Int = 0 + def method1139: Int = 0 + def method1140: Int = 0 + def method1141: Int = 0 + def method1142: Int = 0 + def method1143: Int = 0 + def method1144: Int = 0 + def method1145: Int = 0 + def method1146: Int = 0 + def method1147: Int = 0 + def method1148: Int = 0 + def method1149: Int = 0 + def method1150: Int = 0 + def method1151: Int = 0 + def method1152: Int = 0 + def method1153: Int = 0 + def method1154: Int = 0 + def method1155: Int = 0 + def method1156: Int = 0 + def method1157: Int = 0 + def method1158: Int = 0 + def method1159: Int = 0 + def method1160: Int = 0 + def method1161: Int = 0 + def method1162: Int = 0 + def method1163: Int = 0 + def method1164: Int = 0 + def method1165: Int = 0 + def method1166: Int = 0 + def method1167: Int = 0 + def method1168: Int = 0 + def method1169: Int = 0 + def method1170: Int = 0 + def method1171: Int = 0 + def method1172: Int = 0 + def method1173: Int = 0 + def method1174: Int = 0 + def method1175: Int = 0 + def method1176: Int = 0 + def method1177: Int = 0 + def method1178: Int = 0 + def method1179: Int = 0 + def method1180: Int = 0 + def method1181: Int = 0 + def method1182: Int = 0 + def method1183: Int = 0 + def method1184: Int = 0 + def method1185: Int = 0 + def method1186: Int = 0 + def method1187: Int = 0 + def method1188: Int = 0 + def method1189: Int = 0 + def method1190: Int = 0 + def method1191: Int = 0 + def method1192: Int = 0 + def method1193: Int = 0 + def method1194: Int = 0 + def method1195: Int = 0 + def method1196: Int = 0 + def method1197: Int = 0 + def method1198: Int = 0 + def method1199: Int = 0 + def method1200: Int = 0 + def method1201: Int = 0 + def method1202: Int = 0 + def method1203: Int = 0 + def method1204: Int = 0 + def method1205: Int = 0 + def method1206: Int = 0 + def method1207: Int = 0 + def method1208: Int = 0 + def method1209: Int = 0 + def method1210: Int = 0 + def method1211: Int = 0 + def method1212: Int = 0 + def method1213: Int = 0 + def method1214: Int = 0 + def method1215: Int = 0 + def method1216: Int = 0 + def method1217: Int = 0 + def method1218: Int = 0 + def method1219: Int = 0 + def method1220: Int = 0 + def method1221: Int = 0 + def method1222: Int = 0 + def method1223: Int = 0 + def method1224: Int = 0 + def method1225: Int = 0 + def method1226: Int = 0 + def method1227: Int = 0 + def method1228: Int = 0 + def method1229: Int = 0 + def method1230: Int = 0 + def method1231: Int = 0 + def method1232: Int = 0 + def method1233: Int = 0 + def method1234: Int = 0 + def method1235: Int = 0 + def method1236: Int = 0 + def method1237: Int = 0 + def method1238: Int = 0 + def method1239: Int = 0 + def method1240: Int = 0 + def method1241: Int = 0 + def method1242: Int = 0 + def method1243: Int = 0 + def method1244: Int = 0 + def method1245: Int = 0 + def method1246: Int = 0 + def method1247: Int = 0 + def method1248: Int = 0 + def method1249: Int = 0 + def method1250: Int = 0 + def method1251: Int = 0 + def method1252: Int = 0 + def method1253: Int = 0 + def method1254: Int = 0 + def method1255: Int = 0 + def method1256: Int = 0 + def method1257: Int = 0 + def method1258: Int = 0 + def method1259: Int = 0 + def method1260: Int = 0 + def method1261: Int = 0 + def method1262: Int = 0 + def method1263: Int = 0 + def method1264: Int = 0 + def method1265: Int = 0 + def method1266: Int = 0 + def method1267: Int = 0 + def method1268: Int = 0 + def method1269: Int = 0 + def method1270: Int = 0 + def method1271: Int = 0 + def method1272: Int = 0 + def method1273: Int = 0 + def method1274: Int = 0 + def method1275: Int = 0 + def method1276: Int = 0 + def method1277: Int = 0 + def method1278: Int = 0 + def method1279: Int = 0 + def method1280: Int = 0 + def method1281: Int = 0 + def method1282: Int = 0 + def method1283: Int = 0 + def method1284: Int = 0 + def method1285: Int = 0 + def method1286: Int = 0 + def method1287: Int = 0 + def method1288: Int = 0 + def method1289: Int = 0 + def method1290: Int = 0 + def method1291: Int = 0 + def method1292: Int = 0 + def method1293: Int = 0 + def method1294: Int = 0 + def method1295: Int = 0 + def method1296: Int = 0 + def method1297: Int = 0 + def method1298: Int = 0 + def method1299: Int = 0 + def method1300: Int = 0 + def method1301: Int = 0 + def method1302: Int = 0 + def method1303: Int = 0 + def method1304: Int = 0 + def method1305: Int = 0 + def method1306: Int = 0 + def method1307: Int = 0 + def method1308: Int = 0 + def method1309: Int = 0 + def method1310: Int = 0 + def method1311: Int = 0 + def method1312: Int = 0 + def method1313: Int = 0 + def method1314: Int = 0 + def method1315: Int = 0 + def method1316: Int = 0 + def method1317: Int = 0 + def method1318: Int = 0 + def method1319: Int = 0 + def method1320: Int = 0 + def method1321: Int = 0 + def method1322: Int = 0 + def method1323: Int = 0 + def method1324: Int = 0 + def method1325: Int = 0 + def method1326: Int = 0 + def method1327: Int = 0 + def method1328: Int = 0 + def method1329: Int = 0 + def method1330: Int = 0 + def method1331: Int = 0 + def method1332: Int = 0 + def method1333: Int = 0 + def method1334: Int = 0 + def method1335: Int = 0 + def method1336: Int = 0 + def method1337: Int = 0 + def method1338: Int = 0 + def method1339: Int = 0 + def method1340: Int = 0 + def method1341: Int = 0 + def method1342: Int = 0 + def method1343: Int = 0 + def method1344: Int = 0 + def method1345: Int = 0 + def method1346: Int = 0 + def method1347: Int = 0 + def method1348: Int = 0 + def method1349: Int = 0 + def method1350: Int = 0 + def method1351: Int = 0 + def method1352: Int = 0 + def method1353: Int = 0 + def method1354: Int = 0 + def method1355: Int = 0 + def method1356: Int = 0 + def method1357: Int = 0 + def method1358: Int = 0 + def method1359: Int = 0 + def method1360: Int = 0 + def method1361: Int = 0 + def method1362: Int = 0 + def method1363: Int = 0 + def method1364: Int = 0 + def method1365: Int = 0 + def method1366: Int = 0 + def method1367: Int = 0 + def method1368: Int = 0 + def method1369: Int = 0 + def method1370: Int = 0 + def method1371: Int = 0 + def method1372: Int = 0 + def method1373: Int = 0 + def method1374: Int = 0 + def method1375: Int = 0 + def method1376: Int = 0 + def method1377: Int = 0 + def method1378: Int = 0 + def method1379: Int = 0 + def method1380: Int = 0 + def method1381: Int = 0 + def method1382: Int = 0 + def method1383: Int = 0 + def method1384: Int = 0 + def method1385: Int = 0 + def method1386: Int = 0 + def method1387: Int = 0 + def method1388: Int = 0 + def method1389: Int = 0 + def method1390: Int = 0 + def method1391: Int = 0 + def method1392: Int = 0 + def method1393: Int = 0 + def method1394: Int = 0 + def method1395: Int = 0 + def method1396: Int = 0 + def method1397: Int = 0 + def method1398: Int = 0 + def method1399: Int = 0 + def method1400: Int = 0 + def method1401: Int = 0 + def method1402: Int = 0 + def method1403: Int = 0 + def method1404: Int = 0 + def method1405: Int = 0 + def method1406: Int = 0 + def method1407: Int = 0 + def method1408: Int = 0 + def method1409: Int = 0 + def method1410: Int = 0 + def method1411: Int = 0 + def method1412: Int = 0 + def method1413: Int = 0 + def method1414: Int = 0 + def method1415: Int = 0 + def method1416: Int = 0 + def method1417: Int = 0 + def method1418: Int = 0 + def method1419: Int = 0 + def method1420: Int = 0 + def method1421: Int = 0 + def method1422: Int = 0 + def method1423: Int = 0 + def method1424: Int = 0 + def method1425: Int = 0 + def method1426: Int = 0 + def method1427: Int = 0 + def method1428: Int = 0 + def method1429: Int = 0 + def method1430: Int = 0 + def method1431: Int = 0 + def method1432: Int = 0 + def method1433: Int = 0 + def method1434: Int = 0 + def method1435: Int = 0 + def method1436: Int = 0 + def method1437: Int = 0 + def method1438: Int = 0 + def method1439: Int = 0 + def method1440: Int = 0 + def method1441: Int = 0 + def method1442: Int = 0 + def method1443: Int = 0 + def method1444: Int = 0 + def method1445: Int = 0 + def method1446: Int = 0 + def method1447: Int = 0 + def method1448: Int = 0 + def method1449: Int = 0 + def method1450: Int = 0 + def method1451: Int = 0 + def method1452: Int = 0 + def method1453: Int = 0 + def method1454: Int = 0 + def method1455: Int = 0 + def method1456: Int = 0 + def method1457: Int = 0 + def method1458: Int = 0 + def method1459: Int = 0 + def method1460: Int = 0 + def method1461: Int = 0 + def method1462: Int = 0 + def method1463: Int = 0 + def method1464: Int = 0 + def method1465: Int = 0 + def method1466: Int = 0 + def method1467: Int = 0 + def method1468: Int = 0 + def method1469: Int = 0 + def method1470: Int = 0 + def method1471: Int = 0 + def method1472: Int = 0 + def method1473: Int = 0 + def method1474: Int = 0 + def method1475: Int = 0 + def method1476: Int = 0 + def method1477: Int = 0 + def method1478: Int = 0 + def method1479: Int = 0 + def method1480: Int = 0 + def method1481: Int = 0 + def method1482: Int = 0 + def method1483: Int = 0 + def method1484: Int = 0 + def method1485: Int = 0 + def method1486: Int = 0 + def method1487: Int = 0 + def method1488: Int = 0 + def method1489: Int = 0 + def method1490: Int = 0 + def method1491: Int = 0 + def method1492: Int = 0 + def method1493: Int = 0 + def method1494: Int = 0 + def method1495: Int = 0 + def method1496: Int = 0 + def method1497: Int = 0 + def method1498: Int = 0 + def method1499: Int = 0 + def method1500: Int = 0 + def method1501: Int = 0 + def method1502: Int = 0 + def method1503: Int = 0 + def method1504: Int = 0 + def method1505: Int = 0 + def method1506: Int = 0 + def method1507: Int = 0 + def method1508: Int = 0 + def method1509: Int = 0 + def method1510: Int = 0 + def method1511: Int = 0 + def method1512: Int = 0 + def method1513: Int = 0 + def method1514: Int = 0 + def method1515: Int = 0 + def method1516: Int = 0 + def method1517: Int = 0 + def method1518: Int = 0 + def method1519: Int = 0 + def method1520: Int = 0 + def method1521: Int = 0 + def method1522: Int = 0 + def method1523: Int = 0 + def method1524: Int = 0 + def method1525: Int = 0 + def method1526: Int = 0 + def method1527: Int = 0 + def method1528: Int = 0 + def method1529: Int = 0 + def method1530: Int = 0 + def method1531: Int = 0 + def method1532: Int = 0 + def method1533: Int = 0 + def method1534: Int = 0 + def method1535: Int = 0 + def method1536: Int = 0 + def method1537: Int = 0 + def method1538: Int = 0 + def method1539: Int = 0 + def method1540: Int = 0 + def method1541: Int = 0 + def method1542: Int = 0 + def method1543: Int = 0 + def method1544: Int = 0 + def method1545: Int = 0 + def method1546: Int = 0 + def method1547: Int = 0 + def method1548: Int = 0 + def method1549: Int = 0 + def method1550: Int = 0 + def method1551: Int = 0 + def method1552: Int = 0 + def method1553: Int = 0 + def method1554: Int = 0 + def method1555: Int = 0 + def method1556: Int = 0 + def method1557: Int = 0 + def method1558: Int = 0 + def method1559: Int = 0 + def method1560: Int = 0 + def method1561: Int = 0 + def method1562: Int = 0 + def method1563: Int = 0 + def method1564: Int = 0 + def method1565: Int = 0 + def method1566: Int = 0 + def method1567: Int = 0 + def method1568: Int = 0 + def method1569: Int = 0 + def method1570: Int = 0 + def method1571: Int = 0 + def method1572: Int = 0 + def method1573: Int = 0 + def method1574: Int = 0 + def method1575: Int = 0 + def method1576: Int = 0 + def method1577: Int = 0 + def method1578: Int = 0 + def method1579: Int = 0 + def method1580: Int = 0 + def method1581: Int = 0 + def method1582: Int = 0 + def method1583: Int = 0 + def method1584: Int = 0 + def method1585: Int = 0 + def method1586: Int = 0 + def method1587: Int = 0 + def method1588: Int = 0 + def method1589: Int = 0 + def method1590: Int = 0 + def method1591: Int = 0 + def method1592: Int = 0 + def method1593: Int = 0 + def method1594: Int = 0 + def method1595: Int = 0 + def method1596: Int = 0 + def method1597: Int = 0 + def method1598: Int = 0 + def method1599: Int = 0 + def method1600: Int = 0 + def method1601: Int = 0 + def method1602: Int = 0 + def method1603: Int = 0 + def method1604: Int = 0 + def method1605: Int = 0 + def method1606: Int = 0 + def method1607: Int = 0 + def method1608: Int = 0 + def method1609: Int = 0 + def method1610: Int = 0 + def method1611: Int = 0 + def method1612: Int = 0 + def method1613: Int = 0 + def method1614: Int = 0 + def method1615: Int = 0 + def method1616: Int = 0 + def method1617: Int = 0 + def method1618: Int = 0 + def method1619: Int = 0 + def method1620: Int = 0 + def method1621: Int = 0 + def method1622: Int = 0 + def method1623: Int = 0 + def method1624: Int = 0 + def method1625: Int = 0 + def method1626: Int = 0 + def method1627: Int = 0 + def method1628: Int = 0 + def method1629: Int = 0 + def method1630: Int = 0 + def method1631: Int = 0 + def method1632: Int = 0 + def method1633: Int = 0 + def method1634: Int = 0 + def method1635: Int = 0 + def method1636: Int = 0 + def method1637: Int = 0 + def method1638: Int = 0 + def method1639: Int = 0 + def method1640: Int = 0 + def method1641: Int = 0 + def method1642: Int = 0 + def method1643: Int = 0 + def method1644: Int = 0 + def method1645: Int = 0 + def method1646: Int = 0 + def method1647: Int = 0 + def method1648: Int = 0 + def method1649: Int = 0 + def method1650: Int = 0 + def method1651: Int = 0 + def method1652: Int = 0 + def method1653: Int = 0 + def method1654: Int = 0 + def method1655: Int = 0 + def method1656: Int = 0 + def method1657: Int = 0 + def method1658: Int = 0 + def method1659: Int = 0 + def method1660: Int = 0 + def method1661: Int = 0 + def method1662: Int = 0 + def method1663: Int = 0 + def method1664: Int = 0 + def method1665: Int = 0 + def method1666: Int = 0 + def method1667: Int = 0 + def method1668: Int = 0 + def method1669: Int = 0 + def method1670: Int = 0 + def method1671: Int = 0 + def method1672: Int = 0 + def method1673: Int = 0 + def method1674: Int = 0 + def method1675: Int = 0 + def method1676: Int = 0 + def method1677: Int = 0 + def method1678: Int = 0 + def method1679: Int = 0 + def method1680: Int = 0 + def method1681: Int = 0 + def method1682: Int = 0 + def method1683: Int = 0 + def method1684: Int = 0 + def method1685: Int = 0 + def method1686: Int = 0 + def method1687: Int = 0 + def method1688: Int = 0 + def method1689: Int = 0 + def method1690: Int = 0 + def method1691: Int = 0 + def method1692: Int = 0 + def method1693: Int = 0 + def method1694: Int = 0 + def method1695: Int = 0 + def method1696: Int = 0 + def method1697: Int = 0 + def method1698: Int = 0 + def method1699: Int = 0 + def method1700: Int = 0 + def method1701: Int = 0 + def method1702: Int = 0 + def method1703: Int = 0 + def method1704: Int = 0 + def method1705: Int = 0 + def method1706: Int = 0 + def method1707: Int = 0 + def method1708: Int = 0 + def method1709: Int = 0 + def method1710: Int = 0 + def method1711: Int = 0 + def method1712: Int = 0 + def method1713: Int = 0 + def method1714: Int = 0 + def method1715: Int = 0 + def method1716: Int = 0 + def method1717: Int = 0 + def method1718: Int = 0 + def method1719: Int = 0 + def method1720: Int = 0 + def method1721: Int = 0 + def method1722: Int = 0 + def method1723: Int = 0 + def method1724: Int = 0 + def method1725: Int = 0 + def method1726: Int = 0 + def method1727: Int = 0 + def method1728: Int = 0 + def method1729: Int = 0 + def method1730: Int = 0 + def method1731: Int = 0 + def method1732: Int = 0 + def method1733: Int = 0 + def method1734: Int = 0 + def method1735: Int = 0 + def method1736: Int = 0 + def method1737: Int = 0 + def method1738: Int = 0 + def method1739: Int = 0 + def method1740: Int = 0 + def method1741: Int = 0 + def method1742: Int = 0 + def method1743: Int = 0 + def method1744: Int = 0 + def method1745: Int = 0 + def method1746: Int = 0 + def method1747: Int = 0 + def method1748: Int = 0 + def method1749: Int = 0 + def method1750: Int = 0 + def method1751: Int = 0 + def method1752: Int = 0 + def method1753: Int = 0 + def method1754: Int = 0 + def method1755: Int = 0 + def method1756: Int = 0 + def method1757: Int = 0 + def method1758: Int = 0 + def method1759: Int = 0 + def method1760: Int = 0 + def method1761: Int = 0 + def method1762: Int = 0 + def method1763: Int = 0 + def method1764: Int = 0 + def method1765: Int = 0 + def method1766: Int = 0 + def method1767: Int = 0 + def method1768: Int = 0 + def method1769: Int = 0 + def method1770: Int = 0 + def method1771: Int = 0 + def method1772: Int = 0 + def method1773: Int = 0 + def method1774: Int = 0 + def method1775: Int = 0 + def method1776: Int = 0 + def method1777: Int = 0 + def method1778: Int = 0 + def method1779: Int = 0 + def method1780: Int = 0 + def method1781: Int = 0 + def method1782: Int = 0 + def method1783: Int = 0 + def method1784: Int = 0 + def method1785: Int = 0 + def method1786: Int = 0 + def method1787: Int = 0 + def method1788: Int = 0 + def method1789: Int = 0 + def method1790: Int = 0 + def method1791: Int = 0 + def method1792: Int = 0 + def method1793: Int = 0 + def method1794: Int = 0 + def method1795: Int = 0 + def method1796: Int = 0 + def method1797: Int = 0 + def method1798: Int = 0 + def method1799: Int = 0 + def method1800: Int = 0 + def method1801: Int = 0 + def method1802: Int = 0 + def method1803: Int = 0 + def method1804: Int = 0 + def method1805: Int = 0 + def method1806: Int = 0 + def method1807: Int = 0 + def method1808: Int = 0 + def method1809: Int = 0 + def method1810: Int = 0 + def method1811: Int = 0 + def method1812: Int = 0 + def method1813: Int = 0 + def method1814: Int = 0 + def method1815: Int = 0 + def method1816: Int = 0 + def method1817: Int = 0 + def method1818: Int = 0 + def method1819: Int = 0 + def method1820: Int = 0 + def method1821: Int = 0 + def method1822: Int = 0 + def method1823: Int = 0 + def method1824: Int = 0 + def method1825: Int = 0 + def method1826: Int = 0 + def method1827: Int = 0 + def method1828: Int = 0 + def method1829: Int = 0 + def method1830: Int = 0 + def method1831: Int = 0 + def method1832: Int = 0 + def method1833: Int = 0 + def method1834: Int = 0 + def method1835: Int = 0 + def method1836: Int = 0 + def method1837: Int = 0 + def method1838: Int = 0 + def method1839: Int = 0 + def method1840: Int = 0 + def method1841: Int = 0 + def method1842: Int = 0 + def method1843: Int = 0 + def method1844: Int = 0 + def method1845: Int = 0 + def method1846: Int = 0 + def method1847: Int = 0 + def method1848: Int = 0 + def method1849: Int = 0 + def method1850: Int = 0 + def method1851: Int = 0 + def method1852: Int = 0 + def method1853: Int = 0 + def method1854: Int = 0 + def method1855: Int = 0 + def method1856: Int = 0 + def method1857: Int = 0 + def method1858: Int = 0 + def method1859: Int = 0 + def method1860: Int = 0 + def method1861: Int = 0 + def method1862: Int = 0 + def method1863: Int = 0 + def method1864: Int = 0 + def method1865: Int = 0 + def method1866: Int = 0 + def method1867: Int = 0 + def method1868: Int = 0 + def method1869: Int = 0 + def method1870: Int = 0 + def method1871: Int = 0 + def method1872: Int = 0 + def method1873: Int = 0 + def method1874: Int = 0 + def method1875: Int = 0 + def method1876: Int = 0 + def method1877: Int = 0 + def method1878: Int = 0 + def method1879: Int = 0 + def method1880: Int = 0 + def method1881: Int = 0 + def method1882: Int = 0 + def method1883: Int = 0 + def method1884: Int = 0 + def method1885: Int = 0 + def method1886: Int = 0 + def method1887: Int = 0 + def method1888: Int = 0 + def method1889: Int = 0 + def method1890: Int = 0 + def method1891: Int = 0 + def method1892: Int = 0 + def method1893: Int = 0 + def method1894: Int = 0 + def method1895: Int = 0 + def method1896: Int = 0 + def method1897: Int = 0 + def method1898: Int = 0 + def method1899: Int = 0 + def method1900: Int = 0 + def method1901: Int = 0 + def method1902: Int = 0 + def method1903: Int = 0 + def method1904: Int = 0 + def method1905: Int = 0 + def method1906: Int = 0 + def method1907: Int = 0 + def method1908: Int = 0 + def method1909: Int = 0 + def method1910: Int = 0 + def method1911: Int = 0 + def method1912: Int = 0 + def method1913: Int = 0 + def method1914: Int = 0 + def method1915: Int = 0 + def method1916: Int = 0 + def method1917: Int = 0 + def method1918: Int = 0 + def method1919: Int = 0 + def method1920: Int = 0 + def method1921: Int = 0 + def method1922: Int = 0 + def method1923: Int = 0 + def method1924: Int = 0 + def method1925: Int = 0 + def method1926: Int = 0 + def method1927: Int = 0 + def method1928: Int = 0 + def method1929: Int = 0 + def method1930: Int = 0 + def method1931: Int = 0 + def method1932: Int = 0 + def method1933: Int = 0 + def method1934: Int = 0 + def method1935: Int = 0 + def method1936: Int = 0 + def method1937: Int = 0 + def method1938: Int = 0 + def method1939: Int = 0 + def method1940: Int = 0 + def method1941: Int = 0 + def method1942: Int = 0 + def method1943: Int = 0 + def method1944: Int = 0 + def method1945: Int = 0 + def method1946: Int = 0 + def method1947: Int = 0 + def method1948: Int = 0 + def method1949: Int = 0 + def method1950: Int = 0 + def method1951: Int = 0 + def method1952: Int = 0 + def method1953: Int = 0 + def method1954: Int = 0 + def method1955: Int = 0 + def method1956: Int = 0 + def method1957: Int = 0 + def method1958: Int = 0 + def method1959: Int = 0 + def method1960: Int = 0 + def method1961: Int = 0 + def method1962: Int = 0 + def method1963: Int = 0 + def method1964: Int = 0 + def method1965: Int = 0 + def method1966: Int = 0 + def method1967: Int = 0 + def method1968: Int = 0 + def method1969: Int = 0 + def method1970: Int = 0 + def method1971: Int = 0 + def method1972: Int = 0 + def method1973: Int = 0 + def method1974: Int = 0 + def method1975: Int = 0 + def method1976: Int = 0 + def method1977: Int = 0 + def method1978: Int = 0 + def method1979: Int = 0 + def method1980: Int = 0 + def method1981: Int = 0 + def method1982: Int = 0 + def method1983: Int = 0 + def method1984: Int = 0 + def method1985: Int = 0 + def method1986: Int = 0 + def method1987: Int = 0 + def method1988: Int = 0 + def method1989: Int = 0 + def method1990: Int = 0 + def method1991: Int = 0 + def method1992: Int = 0 + def method1993: Int = 0 + def method1994: Int = 0 + def method1995: Int = 0 + def method1996: Int = 0 + def method1997: Int = 0 + def method1998: Int = 0 + def method1999: Int = 0 + def method2000: Int = 0 + def method2001: Int = 0 + def method2002: Int = 0 + def method2003: Int = 0 + def method2004: Int = 0 + def method2005: Int = 0 + def method2006: Int = 0 + def method2007: Int = 0 + def method2008: Int = 0 + def method2009: Int = 0 + def method2010: Int = 0 + def method2011: Int = 0 + def method2012: Int = 0 + def method2013: Int = 0 + def method2014: Int = 0 + def method2015: Int = 0 + def method2016: Int = 0 + def method2017: Int = 0 + def method2018: Int = 0 + def method2019: Int = 0 + def method2020: Int = 0 + def method2021: Int = 0 + def method2022: Int = 0 + def method2023: Int = 0 + def method2024: Int = 0 + def method2025: Int = 0 + def method2026: Int = 0 + def method2027: Int = 0 + def method2028: Int = 0 + def method2029: Int = 0 + def method2030: Int = 0 + def method2031: Int = 0 + def method2032: Int = 0 + def method2033: Int = 0 + def method2034: Int = 0 + def method2035: Int = 0 + def method2036: Int = 0 + def method2037: Int = 0 + def method2038: Int = 0 + def method2039: Int = 0 + def method2040: Int = 0 + def method2041: Int = 0 + def method2042: Int = 0 + def method2043: Int = 0 + def method2044: Int = 0 + def method2045: Int = 0 + def method2046: Int = 0 + def method2047: Int = 0 + def method2048: Int = 0 + def method2049: Int = 0 + def method2050: Int = 0 + def method2051: Int = 0 + def method2052: Int = 0 + def method2053: Int = 0 + def method2054: Int = 0 + def method2055: Int = 0 + def method2056: Int = 0 + def method2057: Int = 0 + def method2058: Int = 0 + def method2059: Int = 0 + def method2060: Int = 0 + def method2061: Int = 0 + def method2062: Int = 0 + def method2063: Int = 0 + def method2064: Int = 0 + def method2065: Int = 0 + def method2066: Int = 0 + def method2067: Int = 0 + def method2068: Int = 0 + def method2069: Int = 0 + def method2070: Int = 0 + def method2071: Int = 0 + def method2072: Int = 0 + def method2073: Int = 0 + def method2074: Int = 0 + def method2075: Int = 0 + def method2076: Int = 0 + def method2077: Int = 0 + def method2078: Int = 0 + def method2079: Int = 0 + def method2080: Int = 0 + def method2081: Int = 0 + def method2082: Int = 0 + def method2083: Int = 0 + def method2084: Int = 0 + def method2085: Int = 0 + def method2086: Int = 0 + def method2087: Int = 0 + def method2088: Int = 0 + def method2089: Int = 0 + def method2090: Int = 0 + def method2091: Int = 0 + def method2092: Int = 0 + def method2093: Int = 0 + def method2094: Int = 0 + def method2095: Int = 0 + def method2096: Int = 0 + def method2097: Int = 0 + def method2098: Int = 0 + def method2099: Int = 0 + def method2100: Int = 0 + def method2101: Int = 0 + def method2102: Int = 0 + def method2103: Int = 0 + def method2104: Int = 0 + def method2105: Int = 0 + def method2106: Int = 0 + def method2107: Int = 0 + def method2108: Int = 0 + def method2109: Int = 0 + def method2110: Int = 0 + def method2111: Int = 0 + def method2112: Int = 0 + def method2113: Int = 0 + def method2114: Int = 0 + def method2115: Int = 0 + def method2116: Int = 0 + def method2117: Int = 0 + def method2118: Int = 0 + def method2119: Int = 0 + def method2120: Int = 0 + def method2121: Int = 0 + def method2122: Int = 0 + def method2123: Int = 0 + def method2124: Int = 0 + def method2125: Int = 0 + def method2126: Int = 0 + def method2127: Int = 0 + def method2128: Int = 0 + def method2129: Int = 0 + def method2130: Int = 0 + def method2131: Int = 0 + def method2132: Int = 0 + def method2133: Int = 0 + def method2134: Int = 0 + def method2135: Int = 0 + def method2136: Int = 0 + def method2137: Int = 0 + def method2138: Int = 0 + def method2139: Int = 0 + def method2140: Int = 0 + def method2141: Int = 0 + def method2142: Int = 0 + def method2143: Int = 0 + def method2144: Int = 0 + def method2145: Int = 0 + def method2146: Int = 0 + def method2147: Int = 0 + def method2148: Int = 0 + def method2149: Int = 0 + def method2150: Int = 0 + def method2151: Int = 0 + def method2152: Int = 0 + def method2153: Int = 0 + def method2154: Int = 0 + def method2155: Int = 0 + def method2156: Int = 0 + def method2157: Int = 0 + def method2158: Int = 0 + def method2159: Int = 0 + def method2160: Int = 0 + def method2161: Int = 0 + def method2162: Int = 0 + def method2163: Int = 0 + def method2164: Int = 0 + def method2165: Int = 0 + def method2166: Int = 0 + def method2167: Int = 0 + def method2168: Int = 0 + def method2169: Int = 0 + def method2170: Int = 0 + def method2171: Int = 0 + def method2172: Int = 0 + def method2173: Int = 0 + def method2174: Int = 0 + def method2175: Int = 0 + def method2176: Int = 0 + def method2177: Int = 0 + def method2178: Int = 0 + def method2179: Int = 0 + def method2180: Int = 0 + def method2181: Int = 0 + def method2182: Int = 0 + def method2183: Int = 0 + def method2184: Int = 0 + def method2185: Int = 0 + def method2186: Int = 0 + def method2187: Int = 0 + def method2188: Int = 0 + def method2189: Int = 0 + def method2190: Int = 0 + def method2191: Int = 0 + def method2192: Int = 0 + def method2193: Int = 0 + def method2194: Int = 0 + def method2195: Int = 0 + def method2196: Int = 0 + def method2197: Int = 0 + def method2198: Int = 0 + def method2199: Int = 0 + def method2200: Int = 0 + def method2201: Int = 0 + def method2202: Int = 0 + def method2203: Int = 0 + def method2204: Int = 0 + def method2205: Int = 0 + def method2206: Int = 0 + def method2207: Int = 0 + def method2208: Int = 0 + def method2209: Int = 0 + def method2210: Int = 0 + def method2211: Int = 0 + def method2212: Int = 0 + def method2213: Int = 0 + def method2214: Int = 0 + def method2215: Int = 0 + def method2216: Int = 0 + def method2217: Int = 0 + def method2218: Int = 0 + def method2219: Int = 0 + def method2220: Int = 0 + def method2221: Int = 0 + def method2222: Int = 0 + def method2223: Int = 0 + def method2224: Int = 0 + def method2225: Int = 0 + def method2226: Int = 0 + def method2227: Int = 0 + def method2228: Int = 0 + def method2229: Int = 0 + def method2230: Int = 0 + def method2231: Int = 0 + def method2232: Int = 0 + def method2233: Int = 0 + def method2234: Int = 0 + def method2235: Int = 0 + def method2236: Int = 0 + def method2237: Int = 0 + def method2238: Int = 0 + def method2239: Int = 0 + def method2240: Int = 0 + def method2241: Int = 0 + def method2242: Int = 0 + def method2243: Int = 0 + def method2244: Int = 0 + def method2245: Int = 0 + def method2246: Int = 0 + def method2247: Int = 0 + def method2248: Int = 0 + def method2249: Int = 0 + def method2250: Int = 0 + def method2251: Int = 0 + def method2252: Int = 0 + def method2253: Int = 0 + def method2254: Int = 0 + def method2255: Int = 0 + def method2256: Int = 0 + def method2257: Int = 0 + def method2258: Int = 0 + def method2259: Int = 0 + def method2260: Int = 0 + def method2261: Int = 0 + def method2262: Int = 0 + def method2263: Int = 0 + def method2264: Int = 0 + def method2265: Int = 0 + def method2266: Int = 0 + def method2267: Int = 0 + def method2268: Int = 0 + def method2269: Int = 0 + def method2270: Int = 0 + def method2271: Int = 0 + def method2272: Int = 0 + def method2273: Int = 0 + def method2274: Int = 0 + def method2275: Int = 0 + def method2276: Int = 0 + def method2277: Int = 0 + def method2278: Int = 0 + def method2279: Int = 0 + def method2280: Int = 0 + def method2281: Int = 0 + def method2282: Int = 0 + def method2283: Int = 0 + def method2284: Int = 0 + def method2285: Int = 0 + def method2286: Int = 0 + def method2287: Int = 0 + def method2288: Int = 0 + def method2289: Int = 0 + def method2290: Int = 0 + def method2291: Int = 0 + def method2292: Int = 0 + def method2293: Int = 0 + def method2294: Int = 0 + def method2295: Int = 0 + def method2296: Int = 0 + def method2297: Int = 0 + def method2298: Int = 0 + def method2299: Int = 0 + def method2300: Int = 0 + def method2301: Int = 0 + def method2302: Int = 0 + def method2303: Int = 0 + def method2304: Int = 0 + def method2305: Int = 0 + def method2306: Int = 0 + def method2307: Int = 0 + def method2308: Int = 0 + def method2309: Int = 0 + def method2310: Int = 0 + def method2311: Int = 0 + def method2312: Int = 0 + def method2313: Int = 0 + def method2314: Int = 0 + def method2315: Int = 0 + def method2316: Int = 0 + def method2317: Int = 0 + def method2318: Int = 0 + def method2319: Int = 0 + def method2320: Int = 0 + def method2321: Int = 0 + def method2322: Int = 0 + def method2323: Int = 0 + def method2324: Int = 0 + def method2325: Int = 0 + def method2326: Int = 0 + def method2327: Int = 0 + def method2328: Int = 0 + def method2329: Int = 0 + def method2330: Int = 0 + def method2331: Int = 0 + def method2332: Int = 0 + def method2333: Int = 0 + def method2334: Int = 0 + def method2335: Int = 0 + def method2336: Int = 0 + def method2337: Int = 0 + def method2338: Int = 0 + def method2339: Int = 0 + def method2340: Int = 0 + def method2341: Int = 0 + def method2342: Int = 0 + def method2343: Int = 0 + def method2344: Int = 0 + def method2345: Int = 0 + def method2346: Int = 0 + def method2347: Int = 0 + def method2348: Int = 0 + def method2349: Int = 0 + def method2350: Int = 0 + def method2351: Int = 0 + def method2352: Int = 0 + def method2353: Int = 0 + def method2354: Int = 0 + def method2355: Int = 0 + def method2356: Int = 0 + def method2357: Int = 0 + def method2358: Int = 0 + def method2359: Int = 0 + def method2360: Int = 0 + def method2361: Int = 0 + def method2362: Int = 0 + def method2363: Int = 0 + def method2364: Int = 0 + def method2365: Int = 0 + def method2366: Int = 0 + def method2367: Int = 0 + def method2368: Int = 0 + def method2369: Int = 0 + def method2370: Int = 0 + def method2371: Int = 0 + def method2372: Int = 0 + def method2373: Int = 0 + def method2374: Int = 0 + def method2375: Int = 0 + def method2376: Int = 0 + def method2377: Int = 0 + def method2378: Int = 0 + def method2379: Int = 0 + def method2380: Int = 0 + def method2381: Int = 0 + def method2382: Int = 0 + def method2383: Int = 0 + def method2384: Int = 0 + def method2385: Int = 0 + def method2386: Int = 0 + def method2387: Int = 0 + def method2388: Int = 0 + def method2389: Int = 0 + def method2390: Int = 0 + def method2391: Int = 0 + def method2392: Int = 0 + def method2393: Int = 0 + def method2394: Int = 0 + def method2395: Int = 0 + def method2396: Int = 0 + def method2397: Int = 0 + def method2398: Int = 0 + def method2399: Int = 0 + def method2400: Int = 0 + def method2401: Int = 0 + def method2402: Int = 0 + def method2403: Int = 0 + def method2404: Int = 0 + def method2405: Int = 0 + def method2406: Int = 0 + def method2407: Int = 0 + def method2408: Int = 0 + def method2409: Int = 0 + def method2410: Int = 0 + def method2411: Int = 0 + def method2412: Int = 0 + def method2413: Int = 0 + def method2414: Int = 0 + def method2415: Int = 0 + def method2416: Int = 0 + def method2417: Int = 0 + def method2418: Int = 0 + def method2419: Int = 0 + def method2420: Int = 0 + def method2421: Int = 0 + def method2422: Int = 0 + def method2423: Int = 0 + def method2424: Int = 0 + def method2425: Int = 0 + def method2426: Int = 0 + def method2427: Int = 0 + def method2428: Int = 0 + def method2429: Int = 0 + def method2430: Int = 0 + def method2431: Int = 0 + def method2432: Int = 0 + def method2433: Int = 0 + def method2434: Int = 0 + def method2435: Int = 0 + def method2436: Int = 0 + def method2437: Int = 0 + def method2438: Int = 0 + def method2439: Int = 0 + def method2440: Int = 0 + def method2441: Int = 0 + def method2442: Int = 0 + def method2443: Int = 0 + def method2444: Int = 0 + def method2445: Int = 0 + def method2446: Int = 0 + def method2447: Int = 0 + def method2448: Int = 0 + def method2449: Int = 0 + def method2450: Int = 0 + def method2451: Int = 0 + def method2452: Int = 0 + def method2453: Int = 0 + def method2454: Int = 0 + def method2455: Int = 0 + def method2456: Int = 0 + def method2457: Int = 0 + def method2458: Int = 0 + def method2459: Int = 0 + def method2460: Int = 0 + def method2461: Int = 0 + def method2462: Int = 0 + def method2463: Int = 0 + def method2464: Int = 0 + def method2465: Int = 0 + def method2466: Int = 0 + def method2467: Int = 0 + def method2468: Int = 0 + def method2469: Int = 0 + def method2470: Int = 0 + def method2471: Int = 0 + def method2472: Int = 0 + def method2473: Int = 0 + def method2474: Int = 0 + def method2475: Int = 0 + def method2476: Int = 0 + def method2477: Int = 0 + def method2478: Int = 0 + def method2479: Int = 0 + def method2480: Int = 0 + def method2481: Int = 0 + def method2482: Int = 0 + def method2483: Int = 0 + def method2484: Int = 0 + def method2485: Int = 0 + def method2486: Int = 0 + def method2487: Int = 0 + def method2488: Int = 0 + def method2489: Int = 0 + def method2490: Int = 0 + def method2491: Int = 0 + def method2492: Int = 0 + def method2493: Int = 0 + def method2494: Int = 0 + def method2495: Int = 0 + def method2496: Int = 0 + def method2497: Int = 0 + def method2498: Int = 0 + def method2499: Int = 0 + def method2500: Int = 0 + def method2501: Int = 0 + def method2502: Int = 0 + def method2503: Int = 0 + def method2504: Int = 0 + def method2505: Int = 0 + def method2506: Int = 0 + def method2507: Int = 0 + def method2508: Int = 0 + def method2509: Int = 0 + def method2510: Int = 0 + def method2511: Int = 0 + def method2512: Int = 0 + def method2513: Int = 0 + def method2514: Int = 0 + def method2515: Int = 0 + def method2516: Int = 0 + def method2517: Int = 0 + def method2518: Int = 0 + def method2519: Int = 0 + def method2520: Int = 0 + def method2521: Int = 0 + def method2522: Int = 0 + def method2523: Int = 0 + def method2524: Int = 0 + def method2525: Int = 0 + def method2526: Int = 0 + def method2527: Int = 0 + def method2528: Int = 0 + def method2529: Int = 0 + def method2530: Int = 0 + def method2531: Int = 0 + def method2532: Int = 0 + def method2533: Int = 0 + def method2534: Int = 0 + def method2535: Int = 0 + def method2536: Int = 0 + def method2537: Int = 0 + def method2538: Int = 0 + def method2539: Int = 0 + def method2540: Int = 0 + def method2541: Int = 0 + def method2542: Int = 0 + def method2543: Int = 0 + def method2544: Int = 0 + def method2545: Int = 0 + def method2546: Int = 0 + def method2547: Int = 0 + def method2548: Int = 0 + def method2549: Int = 0 + def method2550: Int = 0 + def method2551: Int = 0 + def method2552: Int = 0 + def method2553: Int = 0 + def method2554: Int = 0 + def method2555: Int = 0 + def method2556: Int = 0 + def method2557: Int = 0 + def method2558: Int = 0 + def method2559: Int = 0 + def method2560: Int = 0 + def method2561: Int = 0 + def method2562: Int = 0 + def method2563: Int = 0 + def method2564: Int = 0 + def method2565: Int = 0 + def method2566: Int = 0 + def method2567: Int = 0 + def method2568: Int = 0 + def method2569: Int = 0 + def method2570: Int = 0 + def method2571: Int = 0 + def method2572: Int = 0 + def method2573: Int = 0 + def method2574: Int = 0 + def method2575: Int = 0 + def method2576: Int = 0 + def method2577: Int = 0 + def method2578: Int = 0 + def method2579: Int = 0 + def method2580: Int = 0 + def method2581: Int = 0 + def method2582: Int = 0 + def method2583: Int = 0 + def method2584: Int = 0 + def method2585: Int = 0 + def method2586: Int = 0 + def method2587: Int = 0 + def method2588: Int = 0 + def method2589: Int = 0 + def method2590: Int = 0 + def method2591: Int = 0 + def method2592: Int = 0 + def method2593: Int = 0 + def method2594: Int = 0 + def method2595: Int = 0 + def method2596: Int = 0 + def method2597: Int = 0 + def method2598: Int = 0 + def method2599: Int = 0 + def method2600: Int = 0 + def method2601: Int = 0 + def method2602: Int = 0 + def method2603: Int = 0 + def method2604: Int = 0 + def method2605: Int = 0 + def method2606: Int = 0 + def method2607: Int = 0 + def method2608: Int = 0 + def method2609: Int = 0 + def method2610: Int = 0 + def method2611: Int = 0 + def method2612: Int = 0 + def method2613: Int = 0 + def method2614: Int = 0 + def method2615: Int = 0 + def method2616: Int = 0 + def method2617: Int = 0 + def method2618: Int = 0 + def method2619: Int = 0 + def method2620: Int = 0 + def method2621: Int = 0 + def method2622: Int = 0 + def method2623: Int = 0 + def method2624: Int = 0 + def method2625: Int = 0 + def method2626: Int = 0 + def method2627: Int = 0 + def method2628: Int = 0 + def method2629: Int = 0 + def method2630: Int = 0 + def method2631: Int = 0 + def method2632: Int = 0 + def method2633: Int = 0 + def method2634: Int = 0 + def method2635: Int = 0 + def method2636: Int = 0 + def method2637: Int = 0 + def method2638: Int = 0 + def method2639: Int = 0 + def method2640: Int = 0 + def method2641: Int = 0 + def method2642: Int = 0 + def method2643: Int = 0 + def method2644: Int = 0 + def method2645: Int = 0 + def method2646: Int = 0 + def method2647: Int = 0 + def method2648: Int = 0 + def method2649: Int = 0 + def method2650: Int = 0 + def method2651: Int = 0 + def method2652: Int = 0 + def method2653: Int = 0 + def method2654: Int = 0 + def method2655: Int = 0 + def method2656: Int = 0 + def method2657: Int = 0 + def method2658: Int = 0 + def method2659: Int = 0 + def method2660: Int = 0 + def method2661: Int = 0 + def method2662: Int = 0 + def method2663: Int = 0 + def method2664: Int = 0 + def method2665: Int = 0 + def method2666: Int = 0 + def method2667: Int = 0 + def method2668: Int = 0 + def method2669: Int = 0 + def method2670: Int = 0 + def method2671: Int = 0 + def method2672: Int = 0 + def method2673: Int = 0 + def method2674: Int = 0 + def method2675: Int = 0 + def method2676: Int = 0 + def method2677: Int = 0 + def method2678: Int = 0 + def method2679: Int = 0 + def method2680: Int = 0 + def method2681: Int = 0 + def method2682: Int = 0 + def method2683: Int = 0 + def method2684: Int = 0 + def method2685: Int = 0 + def method2686: Int = 0 + def method2687: Int = 0 + def method2688: Int = 0 + def method2689: Int = 0 + def method2690: Int = 0 + def method2691: Int = 0 + def method2692: Int = 0 + def method2693: Int = 0 + def method2694: Int = 0 + def method2695: Int = 0 + def method2696: Int = 0 + def method2697: Int = 0 + def method2698: Int = 0 + def method2699: Int = 0 + def method2700: Int = 0 + def method2701: Int = 0 + def method2702: Int = 0 + def method2703: Int = 0 + def method2704: Int = 0 + def method2705: Int = 0 + def method2706: Int = 0 + def method2707: Int = 0 + def method2708: Int = 0 + def method2709: Int = 0 + def method2710: Int = 0 + def method2711: Int = 0 + def method2712: Int = 0 + def method2713: Int = 0 + def method2714: Int = 0 + def method2715: Int = 0 + def method2716: Int = 0 + def method2717: Int = 0 + def method2718: Int = 0 + def method2719: Int = 0 + def method2720: Int = 0 + def method2721: Int = 0 + def method2722: Int = 0 + def method2723: Int = 0 + def method2724: Int = 0 + def method2725: Int = 0 + def method2726: Int = 0 + def method2727: Int = 0 + def method2728: Int = 0 + def method2729: Int = 0 + def method2730: Int = 0 + def method2731: Int = 0 + def method2732: Int = 0 + def method2733: Int = 0 + def method2734: Int = 0 + def method2735: Int = 0 + def method2736: Int = 0 + def method2737: Int = 0 + def method2738: Int = 0 + def method2739: Int = 0 + def method2740: Int = 0 + def method2741: Int = 0 + def method2742: Int = 0 + def method2743: Int = 0 + def method2744: Int = 0 + def method2745: Int = 0 + def method2746: Int = 0 + def method2747: Int = 0 + def method2748: Int = 0 + def method2749: Int = 0 + def method2750: Int = 0 + def method2751: Int = 0 + def method2752: Int = 0 + def method2753: Int = 0 + def method2754: Int = 0 + def method2755: Int = 0 + def method2756: Int = 0 + def method2757: Int = 0 + def method2758: Int = 0 + def method2759: Int = 0 + def method2760: Int = 0 + def method2761: Int = 0 + def method2762: Int = 0 + def method2763: Int = 0 + def method2764: Int = 0 + def method2765: Int = 0 + def method2766: Int = 0 + def method2767: Int = 0 + def method2768: Int = 0 + def method2769: Int = 0 + def method2770: Int = 0 + def method2771: Int = 0 + def method2772: Int = 0 + def method2773: Int = 0 + def method2774: Int = 0 + def method2775: Int = 0 + def method2776: Int = 0 + def method2777: Int = 0 + def method2778: Int = 0 + def method2779: Int = 0 + def method2780: Int = 0 + def method2781: Int = 0 + def method2782: Int = 0 + def method2783: Int = 0 + def method2784: Int = 0 + def method2785: Int = 0 + def method2786: Int = 0 + def method2787: Int = 0 + def method2788: Int = 0 + def method2789: Int = 0 + def method2790: Int = 0 + def method2791: Int = 0 + def method2792: Int = 0 + def method2793: Int = 0 + def method2794: Int = 0 + def method2795: Int = 0 + def method2796: Int = 0 + def method2797: Int = 0 + def method2798: Int = 0 + def method2799: Int = 0 + def method2800: Int = 0 + def method2801: Int = 0 + def method2802: Int = 0 + def method2803: Int = 0 + def method2804: Int = 0 + def method2805: Int = 0 + def method2806: Int = 0 + def method2807: Int = 0 + def method2808: Int = 0 + def method2809: Int = 0 + def method2810: Int = 0 + def method2811: Int = 0 + def method2812: Int = 0 + def method2813: Int = 0 + def method2814: Int = 0 + def method2815: Int = 0 + def method2816: Int = 0 + def method2817: Int = 0 + def method2818: Int = 0 + def method2819: Int = 0 + def method2820: Int = 0 + def method2821: Int = 0 + def method2822: Int = 0 + def method2823: Int = 0 + def method2824: Int = 0 + def method2825: Int = 0 + def method2826: Int = 0 + def method2827: Int = 0 + def method2828: Int = 0 + def method2829: Int = 0 + def method2830: Int = 0 + def method2831: Int = 0 + def method2832: Int = 0 + def method2833: Int = 0 + def method2834: Int = 0 + def method2835: Int = 0 + def method2836: Int = 0 + def method2837: Int = 0 + def method2838: Int = 0 + def method2839: Int = 0 + def method2840: Int = 0 + def method2841: Int = 0 + def method2842: Int = 0 + def method2843: Int = 0 + def method2844: Int = 0 + def method2845: Int = 0 + def method2846: Int = 0 + def method2847: Int = 0 + def method2848: Int = 0 + def method2849: Int = 0 + def method2850: Int = 0 + def method2851: Int = 0 + def method2852: Int = 0 + def method2853: Int = 0 + def method2854: Int = 0 + def method2855: Int = 0 + def method2856: Int = 0 + def method2857: Int = 0 + def method2858: Int = 0 + def method2859: Int = 0 + def method2860: Int = 0 + def method2861: Int = 0 + def method2862: Int = 0 + def method2863: Int = 0 + def method2864: Int = 0 + def method2865: Int = 0 + def method2866: Int = 0 + def method2867: Int = 0 + def method2868: Int = 0 + def method2869: Int = 0 + def method2870: Int = 0 + def method2871: Int = 0 + def method2872: Int = 0 + def method2873: Int = 0 + def method2874: Int = 0 + def method2875: Int = 0 + def method2876: Int = 0 + def method2877: Int = 0 + def method2878: Int = 0 + def method2879: Int = 0 + def method2880: Int = 0 + def method2881: Int = 0 + def method2882: Int = 0 + def method2883: Int = 0 + def method2884: Int = 0 + def method2885: Int = 0 + def method2886: Int = 0 + def method2887: Int = 0 + def method2888: Int = 0 + def method2889: Int = 0 + def method2890: Int = 0 + def method2891: Int = 0 + def method2892: Int = 0 + def method2893: Int = 0 + def method2894: Int = 0 + def method2895: Int = 0 + def method2896: Int = 0 + def method2897: Int = 0 + def method2898: Int = 0 + def method2899: Int = 0 + def method2900: Int = 0 + def method2901: Int = 0 + def method2902: Int = 0 + def method2903: Int = 0 + def method2904: Int = 0 + def method2905: Int = 0 + def method2906: Int = 0 + def method2907: Int = 0 + def method2908: Int = 0 + def method2909: Int = 0 + def method2910: Int = 0 + def method2911: Int = 0 + def method2912: Int = 0 + def method2913: Int = 0 + def method2914: Int = 0 + def method2915: Int = 0 + def method2916: Int = 0 + def method2917: Int = 0 + def method2918: Int = 0 + def method2919: Int = 0 + def method2920: Int = 0 + def method2921: Int = 0 + def method2922: Int = 0 + def method2923: Int = 0 + def method2924: Int = 0 + def method2925: Int = 0 + def method2926: Int = 0 + def method2927: Int = 0 + def method2928: Int = 0 + def method2929: Int = 0 + def method2930: Int = 0 + def method2931: Int = 0 + def method2932: Int = 0 + def method2933: Int = 0 + def method2934: Int = 0 + def method2935: Int = 0 + def method2936: Int = 0 + def method2937: Int = 0 + def method2938: Int = 0 + def method2939: Int = 0 + def method2940: Int = 0 + def method2941: Int = 0 + def method2942: Int = 0 + def method2943: Int = 0 + def method2944: Int = 0 + def method2945: Int = 0 + def method2946: Int = 0 + def method2947: Int = 0 + def method2948: Int = 0 + def method2949: Int = 0 + def method2950: Int = 0 + def method2951: Int = 0 + def method2952: Int = 0 + def method2953: Int = 0 + def method2954: Int = 0 + def method2955: Int = 0 + def method2956: Int = 0 + def method2957: Int = 0 + def method2958: Int = 0 + def method2959: Int = 0 + def method2960: Int = 0 + def method2961: Int = 0 + def method2962: Int = 0 + def method2963: Int = 0 + def method2964: Int = 0 + def method2965: Int = 0 + def method2966: Int = 0 + def method2967: Int = 0 + def method2968: Int = 0 + def method2969: Int = 0 + def method2970: Int = 0 + def method2971: Int = 0 + def method2972: Int = 0 + def method2973: Int = 0 + def method2974: Int = 0 + def method2975: Int = 0 + def method2976: Int = 0 + def method2977: Int = 0 + def method2978: Int = 0 + def method2979: Int = 0 + def method2980: Int = 0 + def method2981: Int = 0 + def method2982: Int = 0 + def method2983: Int = 0 + def method2984: Int = 0 + def method2985: Int = 0 + def method2986: Int = 0 + def method2987: Int = 0 + def method2988: Int = 0 + def method2989: Int = 0 + def method2990: Int = 0 + def method2991: Int = 0 + def method2992: Int = 0 + def method2993: Int = 0 + def method2994: Int = 0 + def method2995: Int = 0 + def method2996: Int = 0 + def method2997: Int = 0 + def method2998: Int = 0 + def method2999: Int = 0 +} diff --git a/test/files/run/t7558.scala b/test/files/run/t7558.scala new file mode 100644 index 0000000000..bfcaaba5cc --- /dev/null +++ b/test/files/run/t7558.scala @@ -0,0 +1,9 @@ +object Test extends App { + val cm = reflect.runtime.currentMirror + val u = cm.universe + import scala.tools.reflect.ToolBox + val tb = cm.mkToolBox() + val t = { var x = "ab".toList; u.reify { x = x.reverse; x }.tree } + val evaluated = tb.eval(t) + assert(evaluated == "ba".toList, evaluated) +} diff --git a/test/files/run/t7569.check b/test/files/run/t7569.check new file mode 100644 index 0000000000..98513c3ab2 --- /dev/null +++ b/test/files/run/t7569.check @@ -0,0 +1,12 @@ +source-newSource1.scala,line-3,offset=49 A.this.one +source-newSource1.scala,line-3,offset=49 A.this +source-newSource1.scala,line-4,offset=67 A.super.<init>() +source-newSource1.scala,line-4,offset=67 A.super.<init> +source-newSource1.scala,line-4,offset=67 this +source-newSource1.scala,line-3,offset=49 A.this.one +source-newSource1.scala,line-3,offset=49 A.this +RangePosition(newSource1.scala, 55, 57, 65) scala.Int.box(1).toString() +RangePosition(newSource1.scala, 55, 57, 65) scala.Int.box(1).toString +RangePosition(newSource1.scala, 55, 55, 56) scala.Int.box(1) +NoPosition scala.Int.box +NoPosition scala.Int diff --git a/test/files/run/t7569.scala b/test/files/run/t7569.scala new file mode 100644 index 0000000000..b1b1443a18 --- /dev/null +++ b/test/files/run/t7569.scala @@ -0,0 +1,19 @@ +import scala.tools.partest._ +object Test extends CompilerTest { + import global._ + override def extraSettings = super.extraSettings + " -Yrangepos" + override def sources = List( + """|import scala.language.postfixOps + |class A { + | val one = 1 toString + |}""".stripMargin + ) + def check(source: String, unit: CompilationUnit) { + for (ClassDef(_, _, _, Template(_, _, stats)) <- unit.body ; stat <- stats ; t <- stat) { + t match { + case _: Select | _ : Apply | _:This => println("%-15s %s".format(t.pos.toString, t)) + case _ => + } + } + } +} diff --git a/test/files/run/t7584.check b/test/files/run/t7584.check new file mode 100644 index 0000000000..9f53e5dde5 --- /dev/null +++ b/test/files/run/t7584.check @@ -0,0 +1,6 @@ +no calls +call A +a +call B twice +b +b diff --git a/test/files/run/t7584.flags b/test/files/run/t7584.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/files/run/t7584.flags @@ -0,0 +1 @@ +-Xfatal-warnings
\ No newline at end of file diff --git a/test/files/run/t7584.scala b/test/files/run/t7584.scala new file mode 100644 index 0000000000..6d7f4f7ebb --- /dev/null +++ b/test/files/run/t7584.scala @@ -0,0 +1,14 @@ +// Test case added to show the behaviour of functions with +// by-name parameters. The evaluation behaviour was already correct. +// +// We did flush out a spurious "pure expression does nothing in statement position" +// warning, hence -Xfatal-warnings in the flags file. +object Test extends App { + def foo(f: (=> Int, => Int) => Unit) = f({println("a"); 0}, {println("b"); 1}) + println("no calls") + foo((a, b) => ()) + println("call A") + foo((a, b) => a) + println("call B twice") + foo((a, b) => {b; b}) +} diff --git a/test/files/run/tailcalls.check b/test/files/run/tailcalls.check index f123bc8f25..10384ac46e 100644 --- a/test/files/run/tailcalls.check +++ b/test/files/run/tailcalls.check @@ -1,3 +1,4 @@ +#partest !avian test Object .f was successful test Final .f was successful test Class .f raised exception java.lang.StackOverflowError @@ -51,3 +52,58 @@ test TailCall.b2 was successful test FancyTailCalls.tcTryLocal was successful test FancyTailCalls.differentInstance was successful test PolyObject.tramp was successful + +#partest avian +test Object .f was successful +test Final .f was successful +test Class .f was successful +test SubClass .f was successful +test Sealed .f was successful +test SubSealed.f was successful + +test O .f was successful +test c .f was successful +test O.O .f was successful +test O.c .f was successful +test c.O .f was successful +test c.c .f was successful +test O.O.O .f was successful +test O.O.c .f was successful +test O.c.O .f was successful +test O.c.c .f was successful +test c.O.O .f was successful +test c.O.c .f was successful +test c.c.O .f was successful +test c.c.c .f was successful +test O.O.O.O.f was successful +test O.O.O.c.f was successful +test O.O.c.O.f was successful +test O.O.c.c.f was successful +test O.c.O.O.f was successful +test O.c.O.c.f was successful +test O.c.c.O.f was successful +test O.c.c.c.f was successful +test c.O.O.O.f was successful +test c.O.O.c.f was successful +test c.O.c.O.f was successful +test c.O.c.c.f was successful +test c.c.O.O.f was successful +test c.c.O.c.f was successful +test c.c.c.O.f was successful +test c.c.c.c.f was successful + +test TailCall.f1 was successful +test TailCall.f2 was successful +test TailCall.f3 was successful +test TailCall.g1 was successful +test TailCall.g2 was successful +test TailCall.g3 was successful +test TailCall.h1 was successful + +test NonTailCall.f1 0 1 2 was successful +test NonTailCall.f2 +test TailCall.b1 was successful +test TailCall.b2 was successful +test FancyTailCalls.tcTryLocal was successful +test FancyTailCalls.differentInstance was successful +test PolyObject.tramp was successful
\ No newline at end of file diff --git a/test/files/run/tailcalls.scala b/test/files/run/tailcalls.scala index 7d06a7e69d..1d4124e138 100644 --- a/test/files/run/tailcalls.scala +++ b/test/files/run/tailcalls.scala @@ -307,7 +307,7 @@ object Test { def main(args: Array[String]) { // compute min and max iteration number val min = 16; - val max = calibrate; + val max = if (scala.tools.partest.utils.Properties.isAvian) 10000 else calibrate // test tail calls in different contexts val Final = new Final() diff --git a/test/files/scalacheck/si4147.scala b/test/files/scalacheck/si4147.scala index 1453440ef1..05507b1b18 100644 --- a/test/files/scalacheck/si4147.scala +++ b/test/files/scalacheck/si4147.scala @@ -1,4 +1,4 @@ -import org.scalacheck.Prop.forAll +import org.scalacheck.Prop.{forAll, throws} import org.scalacheck.Properties import org.scalacheck.ConsoleReporter.testStatsEx import org.scalacheck.Gen @@ -64,4 +64,7 @@ object Test extends Properties("Mutable TreeSet") { view.filter(_ < 50) == Set[Int]() && view.filter(_ >= 150) == Set[Int]() } } + + property("ordering must not be null") = + throws(mutable.TreeSet.empty[Int](null), classOf[NullPointerException]) } diff --git a/test/files/scalacheck/treeset.scala b/test/files/scalacheck/treeset.scala index 98e38c8219..018c1b9e29 100644 --- a/test/files/scalacheck/treeset.scala +++ b/test/files/scalacheck/treeset.scala @@ -149,4 +149,7 @@ object Test extends Properties("TreeSet") { val result = subject.foldLeft(subject)((acc, elt) => acc - elt) result.isEmpty } + + property("ordering must not be null") = + throws(TreeSet.empty[Int](null), classOf[NullPointerException]) } diff --git a/test/files/specialized/SI-7344.scala b/test/files/specialized/SI-7344.scala new file mode 100644 index 0000000000..1040460bd1 --- /dev/null +++ b/test/files/specialized/SI-7344.scala @@ -0,0 +1,53 @@ +/* Test for SI-7344, where specialized methods inside the bodies of other + * methods are not specialized, although they might as well be. The name + * for the specialized method should not be different depending on the + * outside method/class' specialization. */ + +class Test[@specialized(Int, Double) X](val x: X) { + + def checkSpecialization[Y](@specialized(Int, Double) y: Y): X = { + + // checking the specialization using the method name, which we can + // extract from an exception's stack trace. We can match just the + // prefix, since the compiler will add a suffix to the method name + // during lambdalift, when it lifts the local methods outside. + def specMe[@specialized(Int, Double) T, N](t: T, n: N): Unit = checkNameStartsWith(n.toString) + + // expected to specialize: + specMe("x", "specMe") + specMe(123, "specMe$mIc$sp") + specMe(1.3, new { override def toString = "specMe$mDc$sp" }) + + x + } + + // name matching: + private[this] def checkNameStartsWith(prefix: String): Unit = { + val method = (new Exception).getStackTrace()(1).getMethodName() + assert(method.startsWith(prefix), method + ".startsWith(" + prefix + ") should be true") + } +} + +object Test extends App { + val t1 = new Test("x") + val t2 = new Test(123) + val t3 = new Test(1.3) + + // we want specialization to rewire these, + // that's why they're not in a for loop: + t1.checkSpecialization("x") + + // Prevented by SI-7579: + // The duplicator loses the @specialized annotation, + // so our tree transformation doesn't know it needs to + // specialize specMe inside the duplicated (and specialized) + // variants of the `checkSpecialization` method + // t1.checkSpecialization(123) + // t1.checkSpecialization(1.3) + // t2.checkSpecialization("x") + // t2.checkSpecialization(123) + // t2.checkSpecialization(1.3) + // t3.checkSpecialization("x") + // t3.checkSpecialization(123) + // t3.checkSpecialization(1.3) +} |