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 @@ -1049,12 +1049,12 @@ class TypeDecoder {
1049
1049
return *optError;
1050
1050
}
1051
1051
1052
- // Unwrap one-element tuples.
1052
+ // Unwrap unlabeled one-element tuples.
1053
1053
//
1054
1054
// FIXME: The behavior of one-element labeled tuples is inconsistent throughout
1055
1055
// the different re-implementations of type substitution and pack expansion.
1056
- // if (elements.size() == 1)
1057
- // return elements[0];
1056
+ if (elements.size () == 1 && labels[ 0 ]. empty () )
1057
+ return elements[0 ];
1058
1058
1059
1059
return Builder.createTupleType (elements, labels);
1060
1060
}
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