From eb0813b9ef437b9c89f8b67ae5b0070b300a0fc1 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 9 Dec 2013 18:29:51 +0100 Subject: Fixes to avoid stale symbols and to avoid methods as pattern constructors. --- tests/pos/sigs.scala | 1 - tests/pos/typers.scala | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/pos/typers.scala (limited to 'tests') diff --git a/tests/pos/sigs.scala b/tests/pos/sigs.scala index 2051ead9a..4c1973cad 100644 --- a/tests/pos/sigs.scala +++ b/tests/pos/sigs.scala @@ -9,7 +9,6 @@ object sigs { class Base { def foo(x: Int): Any = 33 - def foo: Object = "x" } diff --git a/tests/pos/typers.scala b/tests/pos/typers.scala new file mode 100644 index 000000000..3fcd1ff29 --- /dev/null +++ b/tests/pos/typers.scala @@ -0,0 +1,21 @@ +object typers { + + class List[+T] { + def :: (x: T) = new :: (x, this) + + def len: Int = this match { + case x :: xs1 => 1 + xs1.len + case Nil => 0 + } + } + + object Nil extends List[Nothing] + + case class :: [+T] (hd: T, tl: List[T]) extends List[T] + + def len[U](xs: List[U]): Int = xs match { + case x :: xs1 => 1 + len(xs1) + case Nil => 0 + } + +} \ No newline at end of file -- cgit v1.2.3