diff options
author | Martin Odersky <odersky@gmail.com> | 2013-12-09 18:29:51 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-12-09 18:29:51 +0100 |
commit | eb0813b9ef437b9c89f8b67ae5b0070b300a0fc1 (patch) | |
tree | a95eb0b9b2e37a1c4efbf6a665a85c9fba451f25 /tests | |
parent | 42b169a85dacb6a5f1aff9b06bd69065d5f539f2 (diff) | |
download | dotty-eb0813b9ef437b9c89f8b67ae5b0070b300a0fc1.tar.gz dotty-eb0813b9ef437b9c89f8b67ae5b0070b300a0fc1.tar.bz2 dotty-eb0813b9ef437b9c89f8b67ae5b0070b300a0fc1.zip |
Fixes to avoid stale symbols and to avoid methods as pattern constructors.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/sigs.scala | 1 | ||||
-rw-r--r-- | tests/pos/typers.scala | 21 |
2 files changed, 21 insertions, 1 deletions
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 |