File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -1052,12 +1052,12 @@ class TypeDecoder {
1052
1052
return *optError;
1053
1053
}
1054
1054
1055
- // Unwrap one-element tuples.
1055
+ // Unwrap unlabeled one-element tuples.
1056
1056
//
1057
1057
// FIXME: The behavior of one-element labeled tuples is inconsistent throughout
1058
1058
// the different re-implementations of type substitution and pack expansion.
1059
- // if (elements.size() == 1)
1060
- // return elements[0];
1059
+ if (elements.size () == 1 && labels[ 0 ]. empty () )
1060
+ return elements[0 ];
1061
1061
1062
1062
return Builder.createTupleType (elements, labels);
1063
1063
}
Original file line number Diff line number Diff line change @@ -63,13 +63,11 @@ conformances.test("tupleWitnesses") {
63
63
64
64
conformances. test ( " singletonTupleWitnesses " ) {
65
65
let g1 = SingletonTupleWitnesses< Bool> . self
66
- // FIXME: Unwrap one-element tuples
67
- // expectEqual(Bool.self, getA(g1))
66
+ expectEqual ( Bool . self, getA ( g1) )
68
67
69
68
let g2 = SingletonTupleWitnesses< > . self
70
- // FIXME: Unwrap one-element tuples
71
- // expectEqual(Int.self, getB(g2))
72
- // expectEqual(Int.self, getC(g2))
69
+ expectEqual ( Int . self, getB ( g2) )
70
+ expectEqual ( Int . self, getC ( g2) )
73
71
}
74
72
75
73
conformances. test ( " functionWitnesses " ) {
You can’t perform that action at this time.
0 commit comments