Skip to content

Commit 5b2a5ff

Browse files
committed
Fix synthetic parameter generation for context types
1 parent 2ebb4e6 commit 5b2a5ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2160,7 +2160,9 @@ object Parsers {
21602160
}
21612161
else if (isContextual) {
21622162
val tps = commaSeparated(refinedType)
2163-
val params = tps.map(makeSyntheticParameter(nparams + 1, _, Contextual | Implicit))
2163+
var counter = nparams
2164+
def nextIdx = { counter += 1; counter }
2165+
val params = tps.map(makeSyntheticParameter(nextIdx, _, Contextual | Implicit))
21642166
params :: recur(firstClause = false, nparams + params.length)
21652167
}
21662168
else Nil

0 commit comments

Comments
 (0)