@@ -1011,7 +1011,7 @@ object Parsers {
10111011 skipParams()
10121012 lookahead.isColon
10131013 && {
1014- ! sourceVersion.isAtLeast(`3.6`)
1014+ ! sourceVersion.enablesNewGivens
10151015 || { // in the new given syntax, a `:` at EOL after an identifier represents a single identifier given
10161016 // Example:
10171017 // given C:
@@ -1870,7 +1870,7 @@ object Parsers {
18701870 infixOps(t, canStartInfixTypeTokens, operand, Location .ElseWhere , ParseKind .Type ,
18711871 isOperator = ! followingIsVararg()
18721872 && ! isPureArrow
1873- && ! (isIdent(nme.as) && sourceVersion.isAtLeast(`3.6`) && inContextBound)
1873+ && ! (isIdent(nme.as) && sourceVersion.enablesNewGivens && inContextBound)
18741874 && nextCanFollowOperator(canStartInfixTypeTokens))
18751875
18761876 /** RefinedType ::= WithType {[nl] Refinement} [`^` CaptureSet]
@@ -2263,7 +2263,7 @@ object Parsers {
22632263 def contextBound (pname : TypeName ): Tree =
22642264 val t = toplevelTyp(inContextBound = true )
22652265 val ownName =
2266- if isIdent(nme.as) && sourceVersion.isAtLeast(`3.6`) then
2266+ if isIdent(nme.as) && sourceVersion.enablesNewGivens then
22672267 in.nextToken()
22682268 ident()
22692269 else EmptyTermName
@@ -2276,7 +2276,7 @@ object Parsers {
22762276 def contextBounds (pname : TypeName ): List [Tree ] =
22772277 if in.isColon then
22782278 in.nextToken()
2279- if in.token == LBRACE && sourceVersion.isAtLeast(`3.6`)
2279+ if in.token == LBRACE && sourceVersion.enablesNewGivens
22802280 then inBraces(commaSeparated(() => contextBound(pname)))
22812281 else
22822282 val bound = contextBound(pname)
@@ -3500,7 +3500,7 @@ object Parsers {
35003500 val hkparams = typeParamClauseOpt(ParamOwner .Hk )
35013501 val bounds =
35023502 if paramOwner.acceptsCtxBounds then typeAndCtxBounds(name)
3503- else if sourceVersion.isAtLeast(`3.6`) && paramOwner == ParamOwner .Type then typeAndCtxBounds(name)
3503+ else if sourceVersion.enablesNewGivens && paramOwner == ParamOwner .Type then typeAndCtxBounds(name)
35043504 else typeBounds()
35053505 TypeDef (name, lambdaAbstract(hkparams, bounds)).withMods(mods)
35063506 }
@@ -4069,7 +4069,7 @@ object Parsers {
40694069 case SEMI | NEWLINE | NEWLINES | COMMA | RBRACE | OUTDENT | EOF =>
40704070 makeTypeDef(typeAndCtxBounds(tname))
40714071 case _ if (staged & StageKind .QuotedPattern ) != 0
4072- || sourceVersion.isAtLeast(`3.6`) && in.isColon =>
4072+ || sourceVersion.enablesNewGivens && in.isColon =>
40734073 makeTypeDef(typeAndCtxBounds(tname))
40744074 case _ =>
40754075 syntaxErrorOrIncomplete(ExpectedTypeBoundOrEquals (in.token))
@@ -4244,7 +4244,7 @@ object Parsers {
42444244 def givenDef (start : Offset , mods : Modifiers , givenMod : Mod ) = atSpan(start, nameStart) {
42454245 var mods1 = addMod(mods, givenMod)
42464246 val nameStart = in.offset
4247- var newSyntaxAllowed = sourceVersion.isAtLeast(`3.6`)
4247+ var newSyntaxAllowed = sourceVersion.enablesNewGivens
42484248 val hasEmbeddedColon = ! in.isColon && followingIsGivenDefWithColon()
42494249 val name = if isIdent && hasEmbeddedColon then ident() else EmptyTermName
42504250
0 commit comments