From b0298945ddbea26ef00099dc37db5e396af94de4 Mon Sep 17 00:00:00 2001 From: Clemens Winter Date: Fri, 12 Aug 2016 12:16:15 +0200 Subject: Fix #1443: Replace toplevel TypeBounds with Any --- tests/neg/unboundWildcard.scala | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/neg/unboundWildcard.scala (limited to 'tests/neg/unboundWildcard.scala') diff --git a/tests/neg/unboundWildcard.scala b/tests/neg/unboundWildcard.scala new file mode 100644 index 000000000..b137c2664 --- /dev/null +++ b/tests/neg/unboundWildcard.scala @@ -0,0 +1,20 @@ +object unboundWildcard { + + val wildcardVal: _ = 0 // error: unbound wildcard type + + val annotated: _ @unchecked = 0 // error: unbound wildcard type + + def wildcardArg(x: _): Int = 0 // error: unbound wildcard type + + def wildcardResult(x: Int): _ = 0 // error: unbound wildcard type + + val singletonTuple: (((((((_))))))) = ??? // error: unbound wildcard type + + val wildcardBoundedTypeArgL: List[_ <: _] = List(0) // error: unbound wildcard type + val wildcardBoundedTypeArgU: List[_ >: _] = List(0) // error: unbound wildcard type + + def wildcardBoundedTypeParamL[T <: _](x: T): T = x // error: unbound wildcard type + def wildcardBoundedTypeParamU[T >: _](x: T): T = x // error: unbound wildcard type + + val _1403: (_ <: Any) = 1 // error: unbound wildcard type +} -- cgit v1.2.3