summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2014-11-05 16:29:03 +0100
committerLukas Rytz <lukas.rytz@typesafe.com>2014-11-05 16:29:03 +0100
commitb0ab0fca9e7776baf08381a0656cd074a84accc6 (patch)
treee19f4b18e5fe071deb6714f7b0bab655622c867b /test/files/neg
parent494914346ed6f27b44283f4850383582a7a7f6d1 (diff)
parente9843598092579761cccdfcad03a88c61cd5b079 (diff)
downloadscala-b0ab0fca9e7776baf08381a0656cd074a84accc6.tar.gz
scala-b0ab0fca9e7776baf08381a0656cd074a84accc6.tar.bz2
scala-b0ab0fca9e7776baf08381a0656cd074a84accc6.zip
Merge pull request #4044 from retronym/ticket/5091
SI-5091 Move named-args cycle test from pending to neg
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/t5091.check9
-rw-r--r--test/files/neg/t5091.scala11
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/neg/t5091.check b/test/files/neg/t5091.check
new file mode 100644
index 0000000000..abd24e3145
--- /dev/null
+++ b/test/files/neg/t5091.check
@@ -0,0 +1,9 @@
+t5091.scala:8: error: recursive value xxx needs type
+ val param = bar(xxx)
+ ^
+t5091.scala:7: warning: type-checking the invocation of method foo checks if the named argument expression 'param = ...' is a valid assignment
+in the current scope. The resulting type inference error (see above) can be fixed by providing an explicit type in the local definition for param.
+ val xxx = foo(param = null)
+ ^
+one warning found
+one error found
diff --git a/test/files/neg/t5091.scala b/test/files/neg/t5091.scala
new file mode 100644
index 0000000000..217e83f66d
--- /dev/null
+++ b/test/files/neg/t5091.scala
@@ -0,0 +1,11 @@
+object RecursiveValueNeedsType {
+
+ def foo(param: String) = 42
+ def bar(n: Int) = 42
+
+ {
+ val xxx = foo(param = null)
+ val param = bar(xxx)
+ }
+
+}