@@ -73,10 +73,14 @@ enum InlineArrayTests {
73
73
let b : InlineArray < _ , Int > = [ 1 , 2 , 4 , 8 ]
74
74
let c : InlineArray < 4 , _> = [ 1 , 2 , 4 , 8 ]
75
75
let d : InlineArray = [ 1 , 2 , 4 , 8 ]
76
+ let e : InlineArray < 0 , Int > = [ ]
77
+ let f : InlineArray < _ , Int > = [ ]
76
78
_checkInlineArray ( a, oracle: [ 1 , 2 , 4 , 8 ] )
77
79
_checkInlineArray ( b, oracle: [ 1 , 2 , 4 , 8 ] )
78
80
_checkInlineArray ( c, oracle: [ 1 , 2 , 4 , 8 ] )
79
81
_checkInlineArray ( d, oracle: [ 1 , 2 , 4 , 8 ] )
82
+ _checkInlineArray ( e, oracle: [ ] )
83
+ _checkInlineArray ( f, oracle: [ ] )
80
84
}
81
85
do {
82
86
let a = InlineArray< 4 , Int > { 1 << $0 }
@@ -86,7 +90,6 @@ enum InlineArrayTests {
86
90
let e = InlineArray< 0 , Int> ( repeating : 9 )
87
91
_checkInlineArray ( c, oracle: [ 9 , 9 , 9 , 9 ] )
88
92
_checkInlineArray ( d, oracle: [ 9 , 9 , 9 , 9 ] )
89
- _checkInlineArray ( e, oracle: [ ] )
90
93
c [ 0 ] = 1
91
94
c [ 1 ] = 2
92
95
c [ 2 ] = 4
@@ -99,6 +102,7 @@ enum InlineArrayTests {
99
102
_checkInlineArray ( b, oracle: [ 1 , 2 , 4 , 8 ] )
100
103
_checkInlineArray ( c, oracle: [ 1 , 2 , 4 , 8 ] )
101
104
_checkInlineArray ( d, oracle: [ 1 , 2 , 4 , 8 ] )
105
+ _checkInlineArray ( e, oracle: [ ] )
102
106
}
103
107
}
104
108
@@ -138,14 +142,12 @@ enum InlineArrayTests {
138
142
/// An *empty* array's elements can be of *uninhabited* type.
139
143
@available ( SwiftStdlib 6 . 2 , * )
140
144
static func testUninhabited( ) {
141
- #if false // FIXME: Empty array literals aren't supported.
142
145
do {
143
146
let e : InlineArray < 0 , Never > = [ ]
144
147
let f : InlineArray < _ , Never > = [ ]
145
148
_checkInlineArray ( e, oracle: [ ] )
146
149
_checkInlineArray ( f, oracle: [ ] )
147
150
}
148
- #endif
149
151
do {
150
152
let e = InlineArray< 0 , Never > { _ in fatalError ( ) }
151
153
let f = InlineArray< 0 , _> { _ in fatalError ( ) }
0 commit comments