Skip to content

Commit d82b63f

Browse files
added public typealias Element = Element to VLArray
1 parent 84c3a12 commit d82b63f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Sources/VariableLengthArray/VLArray.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
///
55
/// - Warning: May fall back to heap allocation if the compiler/runtime decides the allocation is too big for the stack.
66
public struct VLArray<Element>: ~Copyable, @unchecked Sendable where Element: ~Copyable {
7+
public typealias Element = Element
78
public typealias Index = Int
89

910
@usableFromInline

Tests/swift-variablelengtharrayTests/VariableLengthArrayTests.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ struct VariableLengthArrayTests {
8181
}
8282
}
8383

84+
func vlArrayElementTypealias(
85+
element: VLArrayTypeAlias.Element
86+
) {
87+
}
88+
8489
#if compiler(>=6.2)
8590
@Test
8691
func joinedVLArrayVL() {
@@ -109,4 +114,6 @@ struct TestCopyable {
109114

110115
struct TestNonCopyable: ~Copyable {
111116
let bro:Int
112-
}
117+
}
118+
119+
typealias VLArrayTypeAlias = VLArray<UInt8>

0 commit comments

Comments
 (0)