Skip to content

Commit 33d3622

Browse files
committed
Address review comments
1 parent 11a8fad commit 33d3622

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

compiler/src/dotty/tools/dotc/printing/Formatting.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ object Formatting {
2828
case arg: Showable =>
2929
try arg.show
3030
catch {
31-
case ex: CyclicReference => "..."
31+
case ex: CyclicReference => "... (caught cyclic reference) ..."
3232
case NonFatal(ex)
3333
if !ctx.mode.is(Mode.PrintShowExceptions) &&
3434
!ctx.settings.YshowPrintErrors.value =>

library/src-bootstrapped/scala/StagedTuple.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ object StagedTuple {
122122
}
123123

124124
def applyStaged[Tup <: NonEmptyTuple : Type, N <: Int : Type](tup: Expr[Tup], size: Option[Int], n: Expr[N], nValue: Option[Int]): Expr[Elem[Tup, N]] = {
125-
if (!specialize) '{dynamicApply($tup, $n)}.asInstanceOf // TODO: check that variance is OK here
125+
if (!specialize) '{dynamicApply($tup, $n)}
126126
else {
127127
def fallbackApply(): Expr[Elem[Tup, N]] = nValue match {
128128
case Some(n) => quoted.QuoteError("index out of bounds: " + n)
129-
case None => '{dynamicApply($tup, $n)}.asInstanceOf // TODO: check that variance is OK here
129+
case None => '{dynamicApply($tup, $n)}
130130
}
131131
val res = size match {
132132
case Some(1) =>

library/src-bootstrapped/scala/Tuple.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ sealed trait NonEmptyTuple extends Tuple {
374374
inline def fallbackApply(n: Int) =
375375
inline constValueOpt[n.type] match {
376376
case Some(n: Int) => error("index out of bounds: ", n)
377-
case None => dynamicApply[this.type](this, n)
377+
case None => dynamicApply[this.type, n.type](this, n)
378378
}
379379

380380
inline def apply[This >: this.type <: NonEmptyTuple](n: Int): Elem[This, n.type] =
@@ -462,8 +462,8 @@ object NonEmptyTuple {
462462
res.asInstanceOf[Result]
463463
}
464464

465-
def dynamicApply[This <: NonEmptyTuple] (self: This, n: Int): Elem[This, n.type] = {
466-
type Result = Elem[This, n.type]
465+
def dynamicApply[This <: NonEmptyTuple, N <: Int] (self: This, n: N): Elem[This, N] = {
466+
type Result = Elem[This, N]
467467
val res = (self: Any) match {
468468
case self: TupleXXL => self.elems(n)
469469
case self: Product => self.productElement(n)

0 commit comments

Comments
 (0)