aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/neg/t3873.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/neg/t3873.scala')
-rw-r--r--tests/untried/neg/t3873.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/untried/neg/t3873.scala b/tests/untried/neg/t3873.scala
new file mode 100644
index 000000000..bf5799955
--- /dev/null
+++ b/tests/untried/neg/t3873.scala
@@ -0,0 +1,12 @@
+class A {
+ class B
+ def b: B = new B
+}
+
+object Test {
+ def wrongf(a: A)(b: a.B): a.B = b
+
+ val a = new A
+ wrongf(a)(a.b)
+ wrongf(new A)(a.b) // should not compile
+}