summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/files/run/t5134.scala8
-rw-r--r--test/files/run/t5565.scala12
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/run/t5134.scala b/test/files/run/t5134.scala
new file mode 100644
index 0000000000..384442fda2
--- /dev/null
+++ b/test/files/run/t5134.scala
@@ -0,0 +1,8 @@
+import language._
+
+object Test extends App {
+ def b = new AnyRef {
+ def a= ()
+ }
+ b.a match { case _ => () }
+}
diff --git a/test/files/run/t5565.scala b/test/files/run/t5565.scala
new file mode 100644
index 0000000000..9ced87ca21
--- /dev/null
+++ b/test/files/run/t5565.scala
@@ -0,0 +1,12 @@
+import scala.language.reflectiveCalls
+import scala.language.implicitConversions
+
+object Test extends App {
+ implicit def doubleWithApproxEquals(d: Double) = new {
+ def ~==(v: Double, margin: Double = 0.001): Boolean =
+ math.abs(d - v) < margin
+ }
+
+ assert(math.abs(-4.0) ~== (4.0, 0.001))
+ assert(math.abs(-4.0) ~== 4.0)
+}