Skip to content

Commit f6e23fc

Browse files
committed
more tests
1 parent 6023e47 commit f6e23fc

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Diff for: compiler/src/dotty/tools/dotc/core/TypeEval.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ object TypeEval:
115115
val fieldTypesOpt = tupleElementTypes(arg)
116116
fieldTypesOpt match
117117
case Some(fieldTypes) =>
118-
val fieldLabels = (for i <- 1 to fieldTypes.length yield ConstantType(Constant(s"_$i")))).toList
118+
val fieldLabels = (for i <- 1 to fieldTypes.length yield ConstantType(Constant(s"_$i"))).toList
119119
Some:
120120
defn.NamedTupleTypeRef.appliedTo:
121121
nestedPairs(fieldLabels) :: nestedPairs(fieldTypes) :: Nil

Diff for: tests/pos/i22036.scala

+13
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,16 @@ val res2 = x2._1
1111

1212
val x3: Foo[NamedTuple.From[Tuple.Map[(Int, Int), Foo]]] = ???
1313
val res3 = x3._1
14+
15+
def foo[T <: (Int, String)](tup: T): Int =
16+
tup._1
17+
18+
def union[T](tup: (Int, String)
19+
|(Int, String)
20+
): Int =
21+
tup._1
22+
23+
def intersect[T](tup: (Int, String)
24+
& T
25+
): Int =
26+
tup._1

0 commit comments

Comments
 (0)