summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/phantomValueClass.check1
-rw-r--r--test/files/run/phantomValueClass.scala10
2 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/phantomValueClass.check b/test/files/run/phantomValueClass.check
new file mode 100644
index 0000000000..323fae03f4
--- /dev/null
+++ b/test/files/run/phantomValueClass.check
@@ -0,0 +1 @@
+foobar
diff --git a/test/files/run/phantomValueClass.scala b/test/files/run/phantomValueClass.scala
new file mode 100644
index 0000000000..f6509f2189
--- /dev/null
+++ b/test/files/run/phantomValueClass.scala
@@ -0,0 +1,10 @@
+final class Phantom[A](val s: String) extends AnyVal {
+ def compose(p: Phantom[A]): Phantom[A] = new Phantom[A](s+p.s)
+}
+
+object Test extends App {
+ val x = new Phantom[Int]("foo")
+ val y = new Phantom[Int]("bar")
+ val z = x compose y
+ println(z.s)
+}