Skip to content

Commit b2933b0

Browse files
committed
Fix tests
- tests/pos/automatic-tupling-of-function-parameters.scala This test requires dealiasing. - tests/run/function-arity.scala This test requires widen ExprType. - tests/pos/i6199a.scala It uses a feature which should not be supported.
1 parent 70319b4 commit b2933b0

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ object Applications {
116116
}
117117

118118
def tupleComponentTypes(tp: Type)(using Context): List[Type] =
119-
tp match
119+
tp.widenExpr.dealias match
120120
case tp: AppliedType =>
121121
if defn.isTupleClass(tp.tycon.typeSymbol) then
122122
tp.args

library/src-bootstrapped/scala/Tuple.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ object Tuple {
199199
def apply(): EmptyTuple = EmptyTuple
200200

201201
/** Tuple with one element */
202-
def apply[T](x: T): T *: EmptyTuple = Tuple1(x)
202+
def apply[T](x: T): Tuple1[T] = Tuple1(x)
203203

204204
/** Matches an empty tuple. */
205205
def unapply(x: EmptyTuple): true = true

tests/pos/i6199a.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ case class ValueWithEncoder[T](value: T, encoder: Encoder[T])
33

44
object Test {
55
val a: Seq[ValueWithEncoder[_]] = Seq.empty
6-
val b = a.map((value, encoder) => encoder.encode(value))
6+
val b = a.map(ve => ve.encoder.encode(ve.value))
77
val c: Seq[String] = b
88
}

tests/run/i10958.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ object U:
44
@main
55
def Test =
66
"" match
7-
case s"${U(u)})" =>
7+
case s"${U(u)}" =>
88
val x: String = u

0 commit comments

Comments
 (0)