@@ -468,9 +468,9 @@ object Parsers {
468
468
val l = opInfo.operand
469
469
val r = top
470
470
if (isType && ! op.isBackquoted && op.name == tpnme.raw.BAR ) {
471
- OrTypeTree (l, r )
471
+ OrTypeTree (checkWildcard(l), checkWildcard(r) )
472
472
} else if (isType && ! op.isBackquoted && op.name == tpnme.raw.AMP ) {
473
- AndTypeTree (l, r )
473
+ AndTypeTree (checkWildcard(l), checkWildcard(r) )
474
474
} else
475
475
InfixOp (l, op, r)
476
476
}
@@ -784,7 +784,7 @@ object Parsers {
784
784
val start = in.offset
785
785
val tparams = typeParamClause(ParamOwner .TypeParam )
786
786
if (in.token == ARROW )
787
- atPos(start, in.skipToken())(LambdaTypeTree (tparams, typ ()))
787
+ atPos(start, in.skipToken())(LambdaTypeTree (tparams, toplevelTyp ()))
788
788
else { accept(ARROW ); typ() }
789
789
}
790
790
else infixType()
@@ -822,7 +822,7 @@ object Parsers {
822
822
823
823
def refinedTypeRest (t : Tree ): Tree = {
824
824
newLineOptWhenFollowedBy(LBRACE )
825
- if (in.token == LBRACE ) refinedTypeRest(atPos(startOffset(t)) { RefinedTypeTree (t , refinement()) })
825
+ if (in.token == LBRACE ) refinedTypeRest(atPos(startOffset(t)) { RefinedTypeTree (checkWildcard(t) , refinement()) })
826
826
else t
827
827
}
828
828
@@ -886,7 +886,7 @@ object Parsers {
886
886
private def simpleTypeRest (t : Tree ): Tree = in.token match {
887
887
case HASH => simpleTypeRest(typeProjection(t))
888
888
case LBRACKET => simpleTypeRest(atPos(startOffset(t)) {
889
- AppliedTypeTree (t , typeArgs(namedOK = false , wildOK = true )) })
889
+ AppliedTypeTree (checkWildcard(t) , typeArgs(namedOK = false , wildOK = true )) })
890
890
case _ => t
891
891
}
892
892
@@ -2159,7 +2159,7 @@ object Parsers {
2159
2159
in.token match {
2160
2160
case EQUALS =>
2161
2161
in.nextToken()
2162
- TypeDef (name, lambdaAbstract(tparams, typ ())).withMods(mods).setComment(in.getDocComment(start))
2162
+ TypeDef (name, lambdaAbstract(tparams, toplevelTyp ())).withMods(mods).setComment(in.getDocComment(start))
2163
2163
case SUPERTYPE | SUBTYPE | SEMI | NEWLINE | NEWLINES | COMMA | RBRACE | EOF =>
2164
2164
TypeDef (name, lambdaAbstract(tparams, typeBounds())).withMods(mods).setComment(in.getDocComment(start))
2165
2165
case _ =>
@@ -2287,7 +2287,7 @@ object Parsers {
2287
2287
/** ConstrApp ::= SimpleType {ParArgumentExprs}
2288
2288
*/
2289
2289
val constrApp = () => {
2290
- val t = annotType()
2290
+ val t = checkWildcard( annotType() )
2291
2291
if (in.token == LPAREN ) parArgumentExprss(wrapNew(t))
2292
2292
else t
2293
2293
}
0 commit comments