From 5f6663ee19a95289b5466dab6b1caa92c579bc73 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 10 Oct 2014 16:02:17 +1000 Subject: SI-5091 Move named-args cycle test from pending to neg There is a typechecking cycle, and since 4669ac180e5 we now report this in a clearer manner. Once we change the language to unconditionally interpret an assignent in argument position as a named argument would be the only way to get this over to `pos`. --- test/files/neg/t5091.check | 9 +++++++++ test/files/neg/t5091.scala | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/files/neg/t5091.check create mode 100644 test/files/neg/t5091.scala (limited to 'test/files/neg') 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) + } + +} -- cgit v1.2.3