From 7e695fddac47cc56234fe76c390689c182fad76d Mon Sep 17 00:00:00 2001 From: Yichen Xu Date: Mon, 31 Oct 2022 14:25:12 +0100 Subject: [PATCH] one more test case for capture checking dependent functions --- tests/neg-custom-args/captures/cc-depfun.scala | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/neg-custom-args/captures/cc-depfun.scala diff --git a/tests/neg-custom-args/captures/cc-depfun.scala b/tests/neg-custom-args/captures/cc-depfun.scala new file mode 100644 index 000000000000..c4ef303f4712 --- /dev/null +++ b/tests/neg-custom-args/captures/cc-depfun.scala @@ -0,0 +1,9 @@ +trait Cap { def use(): Unit } + +def main() = { + val f: (io: {*} Cap) -> {} () -> Unit = + io => () => io.use() // error + + val g: ({*} Cap) -> {} () -> Unit = + io => () => io.use() // error +}