Skip to content

Commit 71657e2

Browse files
Fix Swift compiler crash in release mode. (#31)
* Fix Swift compiler crash in release mode. * wip * Update Sources/StructuredQueriesCore/Optional.swift * Update .github/workflows/ci.yml --------- Co-authored-by: Stephen Celis <[email protected]>
1 parent 6315ced commit 71657e2

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Run tests
2828
run: swift test
2929
- name: Build release
30-
run: swift build -c release
30+
run: swift build -c release --build-tests
3131

3232
linux:
3333
name: Linux

Sources/StructuredQueriesCore/Optional.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,10 @@ extension Optional: Table where Wrapped: Table {
100100
)
101101
}
102102

103-
public subscript<QueryValue>(
104-
dynamicMember keyPath: KeyPath<Wrapped.TableColumns, some QueryExpression<QueryValue>>
105-
) -> some QueryExpression<QueryValue?> {
106-
let result: (some QueryExpression<QueryValue>)? = .some(Wrapped.columns[keyPath: keyPath])
107-
return result
103+
public subscript<Member: QueryExpression>(
104+
dynamicMember keyPath: KeyPath<Wrapped.TableColumns, Member>
105+
) -> some QueryExpression<Member.QueryValue?> {
106+
Member?.some(Wrapped.columns[keyPath: keyPath])
108107
}
109108

110109
public subscript<QueryValue>(

0 commit comments

Comments
 (0)