Skip to content

Commit cd42bbe

Browse files
committed
Fix Swift frontend crash
1 parent 98e7ed5 commit cd42bbe

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

Sources/LiveViewNative/Stylesheets/ParseableTypes/PointerStyle+ParseableModifierValue.swift

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,16 @@ extension PointerStyle: ParseableModifierValue {
118118
extension HorizontalDirection.Set: ParseableModifierValue {
119119
public static func parser(in context: ParseableModifierContext) -> some Parser<Substring.UTF8View, Self> {
120120
OneOf {
121-
Array<Self.Element>.parser(in: context).map({ Self.init($0) })
121+
// this fails to compile in release mode in Xcode 16:
122+
// Array<Self.Element>.parser(in: context).map({ Self.init($0) })
123+
ListLiteral {
124+
ImplicitStaticMember([
125+
"all": Self.all,
126+
"leading": Self.leading,
127+
"trailing": Self.trailing,
128+
])
129+
}
130+
.map(Self.init(_:))
122131
ImplicitStaticMember([
123132
"all": Self.all,
124133
"leading": Self.leading,
@@ -132,7 +141,16 @@ extension HorizontalDirection.Set: ParseableModifierValue {
132141
extension VerticalDirection.Set: ParseableModifierValue {
133142
public static func parser(in context: ParseableModifierContext) -> some Parser<Substring.UTF8View, Self> {
134143
OneOf {
135-
Array<Self.Element>.parser(in: context).map({ Self.init($0) })
144+
// this fails to compile in release mode in Xcode 16:
145+
// Array<Self.Element>.parser(in: context).map({ Self.init($0) })
146+
ListLiteral {
147+
ImplicitStaticMember([
148+
"all": Self.all,
149+
"up": Self.up,
150+
"down": Self.down,
151+
])
152+
}
153+
.map(Self.init(_:))
136154
ImplicitStaticMember([
137155
"all": Self.all,
138156
"up": Self.up,
@@ -147,7 +165,16 @@ extension VerticalDirection.Set: ParseableModifierValue {
147165
extension FrameResizeDirection.Set: ParseableModifierValue {
148166
public static func parser(in context: ParseableModifierContext) -> some Parser<Substring.UTF8View, Self> {
149167
OneOf {
150-
Array<Self.Element>.parser(in: context).map({ Self.init($0) })
168+
// this fails to compile in release mode in Xcode 16:
169+
// Array<Self.Element>.parser(in: context).map({ Self.init($0) })
170+
ListLiteral {
171+
ImplicitStaticMember([
172+
"all": Self.all,
173+
"inward": Self.inward,
174+
"outward": Self.outward,
175+
])
176+
}
177+
.map(Self.init(_:))
151178
ImplicitStaticMember([
152179
"all": Self.all,
153180
"inward": Self.inward,

0 commit comments

Comments
 (0)