@@ -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
@@ -1537,7 +1534,7 @@ object Parsers {
1537
1534
/** Same as [[typ ]], but if this results in a wildcard it emits a syntax error and
1538
1535
* returns a tree for type `Any` instead.
1539
1536
*/
1540
- def toplevelTyp (intoOK : IntoOK = IntoOK .No , inContextBound : InContextBound = InContextBound . No ): Tree =
1537
+ def toplevelTyp (intoOK : IntoOK = IntoOK .No , inContextBound : Boolean = false ): Tree =
1541
1538
rejectWildcardType(typ(intoOK, inContextBound))
1542
1539
1543
1540
private def getFunction (tree : Tree ): Option [Function ] = tree match {
@@ -1598,7 +1595,7 @@ object Parsers {
1598
1595
* IntoTargetType ::= Type
1599
1596
* | FunTypeArgs (‘=>’ | ‘?=>’) IntoType
1600
1597
*/
1601
- def typ (intoOK : IntoOK = IntoOK .No , inContextBound : InContextBound = InContextBound . No ): Tree =
1598
+ def typ (intoOK : IntoOK = IntoOK .No , inContextBound : Boolean = false ): Tree =
1602
1599
val start = in.offset
1603
1600
var imods = Modifiers ()
1604
1601
val erasedArgs : ListBuffer [Boolean ] = ListBuffer ()
@@ -1831,13 +1828,13 @@ object Parsers {
1831
1828
/** InfixType ::= RefinedType {id [nl] RefinedType}
1832
1829
* | RefinedType `^` // under capture checking
1833
1830
*/
1834
- def infixType (inContextBound : InContextBound = InContextBound . No ): Tree = infixTypeRest(inContextBound)(refinedType())
1831
+ def infixType (inContextBound : Boolean = false ): Tree = infixTypeRest(inContextBound)(refinedType())
1835
1832
1836
- def infixTypeRest (inContextBound : InContextBound = InContextBound . No )(t : Tree , operand : Location => Tree = refinedTypeFn): Tree =
1833
+ def infixTypeRest (inContextBound : Boolean = false )(t : Tree , operand : Location => Tree = refinedTypeFn): Tree =
1837
1834
infixOps(t, canStartInfixTypeTokens, operand, Location .ElseWhere , ParseKind .Type ,
1838
1835
isOperator = ! followingIsVararg()
1839
1836
&& ! isPureArrow
1840
- && ! (isIdent(nme.as) && sourceVersion.isAtLeast(`3.6`) && inContextBound == InContextBound . Yes )
1837
+ && ! (isIdent(nme.as) && sourceVersion.isAtLeast(`3.6`) && inContextBound)
1841
1838
&& nextCanFollowOperator(canStartInfixTypeTokens))
1842
1839
1843
1840
/** RefinedType ::= WithType {[nl] Refinement} [`^` CaptureSet]
@@ -2228,7 +2225,7 @@ object Parsers {
2228
2225
2229
2226
/** ContextBound ::= Type [`as` id] */
2230
2227
def contextBound (pname : TypeName ): Tree =
2231
- val t = toplevelTyp(inContextBound = InContextBound . Yes )
2228
+ val t = toplevelTyp(inContextBound = true )
2232
2229
val ownName =
2233
2230
if isIdent(nme.as) && sourceVersion.isAtLeast(`3.6`) then
2234
2231
in.nextToken()
0 commit comments