Skip to content

Commit c90f003

Browse files
committed
Fix rebase breakage
1 parent 8c8d6e4 commit c90f003

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
635635

636636
def isSubInfo(info1: Type, info2: Type): Boolean = (info1, info2) match
637637
case (info1: PolyType, info2: PolyType) =>
638-
sameLength(info1.paramNames, info2.paramNames)
638+
info1.paramNames.hasSameLengthAs(info2.paramNames)
639639
&& isSubInfo(info1.resultType, info2.resultType.subst(info2, info1))
640640
case (info1: MethodType, info2: MethodType) =>
641641
matchingMethodParams(info1, info2, precise = false)

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ object Parsers {
904904
&& {
905905
lookahead.observeColonEOL(inTemplate = false)
906906
lookahead.nextToken()
907-
canStartTypeTokens.contains(lookahead.token)
907+
canStartInfixTypeTokens.contains(lookahead.token)
908908
}
909909

910910
/** Is current ident a `*`, and is it followed by a `)`, `, )`, `,EOF`? The latter two are not
@@ -4031,8 +4031,8 @@ object Parsers {
40314031
stats.toList
40324032
}
40334033

4034-
/** SelfType ::= id [‘:’ InfixType] ‘=>’
4035-
* | ‘this’ ‘:’ InfixType ‘=>’
4034+
/** SelfType ::= id [‘:’ [CaptureSet] InfixType] ‘=>’
4035+
* | ‘this’ ‘:’ [CaptureSet] InfixType ‘=>’
40364036
*/
40374037
def selfType(): ValDef =
40384038
if (in.isIdent || in.token == THIS)
@@ -4048,7 +4048,10 @@ object Parsers {
40484048
val selfTpt =
40494049
if in.isColon then
40504050
in.nextToken()
4051-
infixType()
4051+
if in.token == LBRACE && followingIsCaptureSet() then
4052+
CapturingTypeTree(captureSet(), infixType())
4053+
else
4054+
infixType()
40524055
else
40534056
if selfName == nme.WILDCARD then accept(COLONfollow)
40544057
TypeTree()

compiler/src/dotty/tools/dotc/transform/Recheck.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ abstract class Recheck extends Phase, SymTransformer:
187187
def recheckApply(tree: Apply, pt: Type)(using Context): Type =
188188
recheck(tree.fun).widen match
189189
case fntpe: MethodType =>
190-
assert(sameLength(fntpe.paramInfos, tree.args))
190+
assert(fntpe.paramInfos.hasSameLengthAs(tree.args))
191191
val formals =
192192
if tree.symbol.is(JavaDefined) then mapJavaArgs(fntpe.paramInfos)
193193
else fntpe.paramInfos
@@ -208,7 +208,7 @@ abstract class Recheck extends Phase, SymTransformer:
208208
def recheckTypeApply(tree: TypeApply, pt: Type)(using Context): Type =
209209
recheck(tree.fun).widen match
210210
case fntpe: PolyType =>
211-
assert(sameLength(fntpe.paramInfos, tree.args))
211+
assert(fntpe.paramInfos.hasSameLengthAs(tree.args))
212212
val argTypes = tree.args.map(recheck(_))
213213
constFold(tree, fntpe.instantiate(argTypes))
214214

0 commit comments

Comments
 (0)