File tree 2 files changed +14
-1
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ object TypeEval:
115
115
val fieldTypesOpt = tupleElementTypes(arg)
116
116
fieldTypesOpt match
117
117
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
119
119
Some :
120
120
defn.NamedTupleTypeRef .appliedTo:
121
121
nestedPairs(fieldLabels) :: nestedPairs(fieldTypes) :: Nil
Original file line number Diff line number Diff line change @@ -11,3 +11,16 @@ val res2 = x2._1
11
11
12
12
val x3 : Foo [NamedTuple .From [Tuple .Map [(Int , Int ), Foo ]]] = ???
13
13
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
You can’t perform that action at this time.
0 commit comments