@@ -80,9 +80,6 @@ object Parsers {
80
80
enum IntoOK :
81
81
case Yes , No , Nested
82
82
83
- enum InContextBound :
84
- case Yes , No
85
-
86
83
type StageKind = Int
87
84
object StageKind {
88
85
val None = 0
@@ -1553,7 +1550,7 @@ object Parsers {
1553
1550
/** Same as [[typ ]], but if this results in a wildcard it emits a syntax error and
1554
1551
* returns a tree for type `Any` instead.
1555
1552
*/
1556
- def toplevelTyp (intoOK : IntoOK = IntoOK .No , inContextBound : InContextBound = InContextBound . No ): Tree =
1553
+ def toplevelTyp (intoOK : IntoOK = IntoOK .No , inContextBound : Boolean = false ): Tree =
1557
1554
rejectWildcardType(typ(intoOK, inContextBound))
1558
1555
1559
1556
private def getFunction (tree : Tree ): Option [Function ] = tree match {
@@ -1609,7 +1606,7 @@ object Parsers {
1609
1606
* IntoTargetType ::= Type
1610
1607
* | FunTypeArgs (‘=>’ | ‘?=>’) IntoType
1611
1608
*/
1612
- def typ (intoOK : IntoOK = IntoOK .No , inContextBound : InContextBound = InContextBound . No ): Tree =
1609
+ def typ (intoOK : IntoOK = IntoOK .No , inContextBound : Boolean = false ): Tree =
1613
1610
val start = in.offset
1614
1611
var imods = Modifiers ()
1615
1612
val erasedArgs : ListBuffer [Boolean ] = ListBuffer ()
@@ -1836,13 +1833,13 @@ object Parsers {
1836
1833
/** InfixType ::= RefinedType {id [nl] RefinedType}
1837
1834
* | RefinedType `^` // under capture checking
1838
1835
*/
1839
- def infixType (inContextBound : InContextBound = InContextBound . No ): Tree = infixTypeRest(inContextBound)(refinedType())
1836
+ def infixType (inContextBound : Boolean = false ): Tree = infixTypeRest(inContextBound)(refinedType())
1840
1837
1841
- def infixTypeRest (inContextBound : InContextBound = InContextBound . No )(t : Tree , operand : Location => Tree = refinedTypeFn): Tree =
1838
+ def infixTypeRest (inContextBound : Boolean = false )(t : Tree , operand : Location => Tree = refinedTypeFn): Tree =
1842
1839
infixOps(t, canStartInfixTypeTokens, operand, Location .ElseWhere , ParseKind .Type ,
1843
1840
isOperator = ! followingIsVararg()
1844
1841
&& ! isPureArrow
1845
- && ! (isIdent(nme.as) && sourceVersion.isAtLeast(`3.6`) && inContextBound == InContextBound . Yes )
1842
+ && ! (isIdent(nme.as) && sourceVersion.isAtLeast(`3.6`) && inContextBound)
1846
1843
&& nextCanFollowOperator(canStartInfixTypeTokens))
1847
1844
1848
1845
/** RefinedType ::= WithType {[nl] Refinement} [`^` CaptureSet]
@@ -2233,7 +2230,7 @@ object Parsers {
2233
2230
2234
2231
/** ContextBound ::= Type [`as` id] */
2235
2232
def contextBound (pname : TypeName ): Tree =
2236
- val t = toplevelTyp(inContextBound = InContextBound . Yes )
2233
+ val t = toplevelTyp(inContextBound = true )
2237
2234
val ownName =
2238
2235
if isIdent(nme.as) && sourceVersion.isAtLeast(`3.6`) then
2239
2236
in.nextToken()
0 commit comments