diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-13 06:05:27 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-13 06:05:27 -0700 |
commit | 20f701bf504530cb12e9d24e2dd66fa42244664d (patch) | |
tree | 2d5cd89f0fad0f9adb9b01cceb3ba535f40171cd /test/files | |
parent | cfd874ac173ca8d6542921aeea60e1f5ace80b9d (diff) | |
parent | f5e71796d5b964026f5723318d29be5b189b442e (diff) | |
download | scala-20f701bf504530cb12e9d24e2dd66fa42244664d.tar.gz scala-20f701bf504530cb12e9d24e2dd66fa42244664d.tar.bz2 scala-20f701bf504530cb12e9d24e2dd66fa42244664d.zip |
Merge pull request #1296 from paulp/210-errors-and-trees
210 errors and trees
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/names-defaults-neg.check | 2 | ||||
-rw-r--r-- | test/files/neg/wrong-args-for-none.check | 4 | ||||
-rw-r--r-- | test/files/neg/wrong-args-for-none.scala | 6 | ||||
-rw-r--r-- | test/files/pos/z1720.scala | 16 |
4 files changed, 27 insertions, 1 deletions
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check index 2809350855..f3c45a6aa0 100644 --- a/test/files/neg/names-defaults-neg.check +++ b/test/files/neg/names-defaults-neg.check @@ -76,7 +76,7 @@ and method f in object t8 of type (a: Int, b: Object)String match argument types (a: Int,b: String) and expected result type Any println(t8.f(a = 0, b = "1")) // ambigous reference ^ -names-defaults-neg.scala:69: error: wrong number of arguments for <none>: (x: Int, y: String)A1 +names-defaults-neg.scala:69: error: wrong number of arguments for pattern A1(x: Int,y: String) A1() match { case A1(_) => () } ^ names-defaults-neg.scala:76: error: no type parameters for method test4: (x: T[T[List[T[X forSome { type X }]]]])T[T[List[T[X forSome { type X }]]]] exist so that it can be applied to arguments (List[Int]) diff --git a/test/files/neg/wrong-args-for-none.check b/test/files/neg/wrong-args-for-none.check new file mode 100644 index 0000000000..d3b2d572ab --- /dev/null +++ b/test/files/neg/wrong-args-for-none.check @@ -0,0 +1,4 @@ +wrong-args-for-none.scala:5: error: wrong number of arguments for pattern Test.Foo(x: Int,y: Int) + def f(x: Any) = x match { case Bar(Foo(5)) => } + ^ +one error found diff --git a/test/files/neg/wrong-args-for-none.scala b/test/files/neg/wrong-args-for-none.scala new file mode 100644 index 0000000000..1caa4782a3 --- /dev/null +++ b/test/files/neg/wrong-args-for-none.scala @@ -0,0 +1,6 @@ +object Test { + case class Foo(x: Int, y: Int) + case class Bar(x: AnyRef) + + def f(x: Any) = x match { case Bar(Foo(5)) => } +} diff --git a/test/files/pos/z1720.scala b/test/files/pos/z1720.scala new file mode 100644 index 0000000000..7394d428c1 --- /dev/null +++ b/test/files/pos/z1720.scala @@ -0,0 +1,16 @@ +package test + +class Thing { + def info: Info[this.type] = InfoRepository.getInfo(this) + def info2: Info[this.type] = { + def self: this.type = this + InfoRepository.getInfo(self) + } +} + +trait Info[T] +case class InfoImpl[T](thing: T) extends Info[T] + +object InfoRepository { + def getInfo(t: Thing): Info[t.type] = InfoImpl(t) +} |