Skip to content

Commit dea7a32

Browse files
Remove explicit use of Tuple2
This change is needed for scala/scala3#2199. The idea is to have `type Tuple2[A, B] = (A, B) // Desugars into TupleCons[A, TupleCons[B, Unit]]` in Predef, so that users can refer to "a tuple of size 2" either with `(A, B)` or `Tuple2[A, B]`. It's still possible to refer to the actually underlying class with the explicit prefix, `scala.Tuple2`. Because this code is inside the scala package and mixes the two syntax in breaks with the above PR...
1 parent 7246c2b commit dea7a32

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
808808
var flatKeys: List[Int] = Nil
809809
var targets: List[asm.Label] = Nil
810810
var default: asm.Label = null
811-
var switchBlocks: List[Tuple2[asm.Label, Tree]] = Nil
811+
var switchBlocks: List[(asm.Label, Tree)] = Nil
812812

813813
// collect switch blocks and their keys, but don't emit yet any switch-block.
814814
for (caze @ CaseDef(pat, guard, body) <- cases) {

src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ trait BCodeSkelBuilder extends BCodeHelpers {
432432
var labelDef: scala.collection.Map[Symbol, LabelDef] = null// (LabelDef-sym -> LabelDef)
433433

434434
// bookkeeping the scopes of non-synthetic local vars, to emit debug info (`emitVars`).
435-
var varsInScope: List[Tuple2[Symbol, asm.Label]] = null // (local-var-sym -> start-of-scope)
435+
var varsInScope: List[(Symbol, asm.Label)] = null // (local-var-sym -> start-of-scope)
436436

437437
// helpers around program-points.
438438
def lastInsn: asm.tree.AbstractInsnNode = {

0 commit comments

Comments
 (0)