diff options
Diffstat (limited to 'tests/neg/i803.scala')
-rw-r--r-- | tests/neg/i803.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/neg/i803.scala b/tests/neg/i803.scala new file mode 100644 index 000000000..7bae36336 --- /dev/null +++ b/tests/neg/i803.scala @@ -0,0 +1,11 @@ +class Foo{ + val default = this + def foo(a: Int)(b: Foo = default): b.type = b + + def bar(b: Foo = default): b.type = b + val x: Foo = bar() // ok + val x2: Foo = foo(1)() // ok + + val s: Foo = foo(1) // error + val s2: default.type = foo(1) // error +} |