We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62348de commit 7d34d28Copy full SHA for 7d34d28
src/dotty/tools/dotc/parsing/Parsers.scala
@@ -652,8 +652,12 @@ object Parsers {
652
*/
653
def toplevelTyp(): Tree = {
654
val t = typ()
655
- for (wildcardPos <- findWildcardType(t)) syntaxError("unbound wildcard type", wildcardPos)
656
- t
+ findWildcardType(t) match {
+ case Some(wildcardPos) =>
657
+ syntaxError("unbound wildcard type", wildcardPos)
658
+ Ident(Names.typeName("Any")).withPos(t.pos)
659
+ case None => t
660
+ }
661
}
662
663
/** Type ::= FunArgTypes `=>' Type
tests/pending/neg/unboundWildcard.scala renamed to tests/neg/unboundWildcard.scala
@@ -1,6 +1,5 @@
1
object unboundWildcard {
2
3
- // TODO: move this to tests/neg once it doesn't crash the compiler anymore
4
val wildcardVal: _ = 0 // error: unbound wildcard type
5
6
val annotated: _ @unchecked = 0 // error: unbound wildcard type
0 commit comments