diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t5091.check | 9 | ||||
-rw-r--r-- | test/files/neg/t5091.scala (renamed from test/pending/pos/t5091.scala) | 0 | ||||
-rw-r--r-- | test/files/pos/t6051.scala | 19 |
3 files changed, 28 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/pending/pos/t5091.scala b/test/files/neg/t5091.scala index 217e83f66d..217e83f66d 100644 --- a/test/pending/pos/t5091.scala +++ b/test/files/neg/t5091.scala diff --git a/test/files/pos/t6051.scala b/test/files/pos/t6051.scala new file mode 100644 index 0000000000..854524feb9 --- /dev/null +++ b/test/files/pos/t6051.scala @@ -0,0 +1,19 @@ +object Foo1 { + def foo(x: Int, y: Int = 10) = x*y + lazy val y = foo(x = 20) +} + +object Foo2 { + def foo(x: Int, y: Int = 10) = x*y + val y = foo(x = 20) +} + +object Foo3 { + def foo(x: Int, y: Int = 10) = x*y + def y = foo(x = 20) +} + +object Foo4 { + def foo(x: Int, y: Int = 10) = x*y + var y = foo(x = 20) +} |