File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -11,3 +11,16 @@ val res2 = x2._1
1111
1212val x3 : Foo [NamedTuple .From [Tuple .Map [(Int , Int ), Foo ]]] = ???
1313val 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