summaryrefslogtreecommitdiff
path: root/test/files/run/records.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-10-02 23:19:16 +0000
committerPaul Phillips <paulp@improving.org>2010-10-02 23:19:16 +0000
commit943fbb1363345fdaca55e5df95059e8ce8c1344b (patch)
treeb12582afc26fe0e3d0dc4a502eef5e6a2d41bfb3 /test/files/run/records.scala
parent06aa1c9eff49d5190e82a72a876d7b3bd706d6d4 (diff)
downloadscala-943fbb1363345fdaca55e5df95059e8ce8c1344b.tar.gz
scala-943fbb1363345fdaca55e5df95059e8ce8c1344b.tar.bz2
scala-943fbb1363345fdaca55e5df95059e8ce8c1344b.zip
The next batch of tests put up a little more st...
The next batch of tests put up a little more struggle, but only a little. See test/pending/pos/unappgadteval.scala (the changes for which were in the previous commit) for an example of a test which might be on to something. Any idea what it would take to get it working? // the key lines case i @ Suc() => { (y: Int) => y + 1 } // a = Int => Int case f @ Lam[b,c](x, e) => { (y: b) => eval(e, env.extend(x, y)) } // a = b=>c No review.
Diffstat (limited to 'test/files/run/records.scala')
-rw-r--r--test/files/run/records.scala27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/files/run/records.scala b/test/files/run/records.scala
new file mode 100644
index 0000000000..c1dc7b67e8
--- /dev/null
+++ b/test/files/run/records.scala
@@ -0,0 +1,27 @@
+trait C {
+ def f: Int
+}
+
+object Test {
+ type T = C {
+ def f: Int
+ def g: String
+ }
+
+ val x: T = new C {
+ def f = 1
+ def g = "hello"
+ }
+
+ val y = new C {
+ def f = 2
+ def g = " world"
+ }
+
+ val z: T = y
+
+ def main(args: Array[String]): Unit = {
+ assert(x.f+z.f == 3)
+ assert(x.g+z.g == "hello world")
+ }
+}