summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2010-09-01 13:25:57 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2010-09-01 13:25:57 +0000
commit27c9348ba828374df3e36b86103cf70abd82647e (patch)
treea77c3aed74add58639ae816ccf0b647de2737c8e /test/files/neg
parent01c28cdc53d5655eb04c393565a482daaff038ff (diff)
downloadscala-27c9348ba828374df3e36b86103cf70abd82647e.tar.gz
scala-27c9348ba828374df3e36b86103cf70abd82647e.tar.bz2
scala-27c9348ba828374df3e36b86103cf70abd82647e.zip
Merged revisions 22121,22393,22416,22426,22524-...
Merged revisions 22121,22393,22416,22426,22524-22525,22549 via svnmerge from https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk ........ r22121 | rytz | 2010-06-02 11:57:41 +0200 (Wed, 02 Jun 2010) | 1 line some tests. no review ........ r22393 | rytz | 2010-06-24 18:43:40 +0200 (Thu, 24 Jun 2010) | 1 line close #3543 ........ r22416 | rytz | 2010-06-29 14:32:45 +0200 (Tue, 29 Jun 2010) | 1 line close #2413. maybe there's better place to this conversion, therefore review by odersky. ........ r22426 | rytz | 2010-06-30 13:03:00 +0200 (Wed, 30 Jun 2010) | 1 line moved toScalaRepeatedParam TypeMap to refchecks. no review ........ r22524 | rytz | 2010-07-09 11:51:03 +0200 (Fri, 09 Jul 2010) | 1 line close #3649. no review ........ r22525 | rytz | 2010-07-09 11:51:06 +0200 (Fri, 09 Jul 2010) | 1 line close #3648. default getters for constructor defaults are now static. however, they still need to live in the companion object to avoid name conflicts when subclasses also define constructor defaults. review by odersky. ........ r22549 | rytz | 2010-07-13 09:14:37 +0200 (Tue, 13 Jul 2010) | 1 line close #3648 (again). objects extending their companion class can no longer use default constructor arguments. review by odersky ........
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/names-defaults-neg.check13
-rw-r--r--test/files/neg/names-defaults-neg.scala5
2 files changed, 13 insertions, 5 deletions
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check
index 38bacc0888..b2b00b7050 100644
--- a/test/files/neg/names-defaults-neg.check
+++ b/test/files/neg/names-defaults-neg.check
@@ -104,17 +104,20 @@ names-defaults-neg.scala:82: error: type mismatch;
Error occurred in an application involving default arguments.
new A2[String]()
^
-names-defaults-neg.scala:115: error: reference to var2 is ambiguous; it is both, a parameter
+names-defaults-neg.scala:86: error: module extending its companion class cannot use default constructor arguments
+ object C extends C()
+ ^
+names-defaults-neg.scala:120: error: reference to var2 is ambiguous; it is both, a parameter
name of the method and the name of a variable currently in scope.
delay(var2 = 40)
^
-names-defaults-neg.scala:118: error: missing parameter type for expanded function ((x$1) => a = x$1)
+names-defaults-neg.scala:123: error: missing parameter type for expanded function ((x$1) => a = x$1)
val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
^
-names-defaults-neg.scala:119: error: parameter specified twice: a
+names-defaults-neg.scala:124: error: parameter specified twice: a
val taf3 = testAnnFun(b = _: String, a = get(8))
^
-names-defaults-neg.scala:120: error: wrong number of parameters; expected = 2
+names-defaults-neg.scala:125: error: wrong number of parameters; expected = 2
val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
^
-28 errors found
+29 errors found
diff --git a/test/files/neg/names-defaults-neg.scala b/test/files/neg/names-defaults-neg.scala
index e73dc71c9b..43883540a0 100644
--- a/test/files/neg/names-defaults-neg.scala
+++ b/test/files/neg/names-defaults-neg.scala
@@ -81,6 +81,11 @@ object Test extends Application {
// correct error message
new A2[String]()
+ object t3648 {
+ class C(val s: String = "")
+ object C extends C()
+ }
+
// DEFINITIONS
def test1(a: Int, b: String) = a +": "+ b
def test2(x: Unit) = println("test2")