From eb4bb1d092014be19b1669a7c16c6df3e11fda28 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 19 Dec 2014 19:01:29 +0100 Subject: New passing tests. --- tests/pos/S5.scala | 31 +++++++++++++++++++++++++++++++ tests/pos/SI-5788.scala | 3 +++ 2 files changed, 34 insertions(+) create mode 100644 tests/pos/S5.scala create mode 100644 tests/pos/SI-5788.scala (limited to 'tests/pos') diff --git a/tests/pos/S5.scala b/tests/pos/S5.scala new file mode 100644 index 000000000..ba87869a1 --- /dev/null +++ b/tests/pos/S5.scala @@ -0,0 +1,31 @@ +/* Original comment: + * Here's a fragment of a Scala encoding for the Keris module system; +** the compiler claims: +** +** S5.scala:28: value n in class N of type N.this._N.n +** cannot override value n in class M of type M.this._N.n +** val system = new M() with N() {} +** ^ +** To me it seems like the code is perfectly fine... +*/ +abstract class M() { + val _N: N; + val n: _N.n; + val _M: M = this; + val m: _M.m = new _M.m(); + class m() { + // module body of M + } +} +trait N { + val _N: N = this; + val n: _N.n = new _N.n(); + val _M: M; + val m: _M.m; + class n() { + // module body of N + } +} +object O { + val system = new M() with N {} +} diff --git a/tests/pos/SI-5788.scala b/tests/pos/SI-5788.scala new file mode 100644 index 000000000..f29246180 --- /dev/null +++ b/tests/pos/SI-5788.scala @@ -0,0 +1,3 @@ +trait Foo[@specialized(Int) A] { + final def bar(a:A):A = bar(a) +} -- cgit v1.2.3