diff options
author | Clemens Winter <clemenswinter1@gmail.com> | 2016-07-25 16:08:29 +0200 |
---|---|---|
committer | Clemens Winter <clemenswinter1@gmail.com> | 2016-08-01 14:38:45 +0200 |
commit | 9e9b9807b0f272ef586a5a92e6fc87de46c6da9d (patch) | |
tree | 3d20a6dfa7a5928e7247db3e4a2af91b7391b2c7 /tests/pending | |
parent | 835c92c9fe2f9eb7560b64a2557df56402c05332 (diff) | |
download | dotty-9e9b9807b0f272ef586a5a92e6fc87de46c6da9d.tar.gz dotty-9e9b9807b0f272ef586a5a92e6fc87de46c6da9d.tar.bz2 dotty-9e9b9807b0f272ef586a5a92e6fc87de46c6da9d.zip |
Add tests for unbound wildcard types
Diffstat (limited to 'tests/pending')
-rw-r--r-- | tests/pending/neg/unboundWildcard.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/pending/neg/unboundWildcard.scala b/tests/pending/neg/unboundWildcard.scala new file mode 100644 index 000000000..eeee04fde --- /dev/null +++ b/tests/pending/neg/unboundWildcard.scala @@ -0,0 +1,21 @@ +object unboundWildcard { + + // TODO: move this to tests/neg once it doesn't crash the compiler anymore + 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 +} |