summaryrefslogtreecommitdiff
path: root/test/files/run/reify_properties.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2015-07-01 13:53:37 +0200
committerAdriaan Moors <adriaan.moors@typesafe.com>2015-07-01 11:56:35 -0700
commitbf951ec134e8ee2fcfc28152b6d72ddb2c42b988 (patch)
tree44d0af6e25b7d5ee14f0a3cf0715c1db7d6ce632 /test/files/run/reify_properties.scala
parentc58f4e4a85ddf9a6d9441b94b1acdccab2d105b4 (diff)
downloadscala-bf951ec134e8ee2fcfc28152b6d72ddb2c42b988.tar.gz
scala-bf951ec134e8ee2fcfc28152b6d72ddb2c42b988.tar.bz2
scala-bf951ec134e8ee2fcfc28152b6d72ddb2c42b988.zip
Fix some tests, move others to pending/
Move run/t8960 to pending It tests the serialVersionUID field on closure classes. The field doesn't exist for indyLambda closures. See https://issues.scala-lang.org/browse/SI-9373 Move some reify tests to pending They fail at runtime in GenBCode since scala is built with indyLambda enabled: java.lang.AssertionError: assertion failed: Bad superClass for trait JFunction1: class Any at scala.tools.nsc.Global.assert(Global.scala:261) at scala.tools.nsc.backend.jvm.BTypesFromSymbols.setClassInfo(BTypesFromSymbols.scala:228) Noted in https://issues.scala-lang.org/browse/SI-9374 force t6546 to GenASM - no closure elimination in GenBCode yet Noted in https://issues.scala-lang.org/browse/SI-9364. Fix or disable some tests that fail because of the old optimizer The old inliner fails more often when the library is built with indylambda. Noted in https://issues.scala-lang.org/browse/SI-9374. Example: List.foreach ➜ sandbox git:(jfun) ✗ qs -Ybackend:GenASM -optimize -Yinline-warnings Welcome to Scala version 2.12.0-20150630-220939-1cb032d806 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45). Type in expressions to have them evaluated. Type :help for more information. scala> List(1,2,3).foreach(x => x + 1) <console>:11: warning: Could not inline required method foreach because bytecode unavailable. List(1,2,3).foreach(x => x + 1) ^ <console>:11: warning: At the end of the day, could not inline @inline-marked method foreach List(1,2,3).foreach(x => x + 1) ^ Upate a number of tests for having indyLambda enabled The delambdafyLambdaClassNames tests was removed, there's nothing to tests with indyLambda.
Diffstat (limited to 'test/files/run/reify_properties.scala')
-rw-r--r--test/files/run/reify_properties.scala57
1 files changed, 0 insertions, 57 deletions
diff --git a/test/files/run/reify_properties.scala b/test/files/run/reify_properties.scala
deleted file mode 100644
index 01a9b12a92..0000000000
--- a/test/files/run/reify_properties.scala
+++ /dev/null
@@ -1,57 +0,0 @@
-import scala.reflect.runtime.universe._
-import scala.tools.reflect.Eval
-
-object Test extends App {
- reify {
- /** A mutable property whose getter and setter may be customized. */
- case class Property[T](init: T) {
- private var value: T = init
-
- /** The getter function, defaults to identity. */
- private var setter: T => T = identity[T]
-
- /** The setter function, defaults to identity. */
- private var getter: T => T = identity[T]
-
- /** Retrive the value held in this property. */
- def apply(): T = getter(value)
-
- /** Update the value held in this property, through the setter. */
- def update(newValue: T) = value = setter(newValue)
-
- /** Change the getter. */
- def get(newGetter: T => T) = { getter = newGetter; this }
-
- /** Change the setter */
- def set(newSetter: T => T) = { setter = newSetter; this }
- }
-
- class User {
- // Create a property with custom getter and setter
- val firstname = Property("")
- .get { v => v.toUpperCase() }
- .set { v => "Mr. " + v }
- val lastname = Property("<noname>")
-
- /** Scala provides syntactic sugar for calling 'apply'. Simply
- * adding a list of arguments between parenthesis (in this case,
- * an empty list) is translated to a call to 'apply' with those
- * arguments.
- */
- override def toString() = firstname() + " " + lastname()
- }
-
- val user1 = new User
-
- // Syntactic sugar for 'update': an assignment is translated to a
- // call to method 'update'
- user1.firstname() = "Robert"
-
- val user2 = new User
- user2.firstname() = "bob"
- user2.lastname() = "KUZ"
-
- println("user1: " + user1)
- println("user2: " + user2)
- }.eval
-}