aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos/t6925.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/pos/t6925.scala')
-rw-r--r--tests/untried/pos/t6925.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/untried/pos/t6925.scala b/tests/untried/pos/t6925.scala
new file mode 100644
index 000000000..c6f418519
--- /dev/null
+++ b/tests/untried/pos/t6925.scala
@@ -0,0 +1,9 @@
+class Test {
+ def f[T](xs: Set[T]) /* no expected type to trigger inference */ =
+ xs collect { case x => x }
+
+ def g[T](xs: Set[T]): Set[T] = f[T](xs) // check that f's inferred type is Set[T]
+
+ // check that this type checks:
+ List(1).flatMap(n => Set(1).collect { case w => w })
+}