Skip to content

Comments

BridgeJS: Fix Array<@JSClass struct> support on imported interfaces#665

Merged
krodak merged 2 commits intomainfrom
fix-swift-class-array
Feb 20, 2026
Merged

BridgeJS: Fix Array<@JSClass struct> support on imported interfaces#665
krodak merged 2 commits intomainfrom
fix-swift-class-array

Conversation

@kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Feb 19, 2026

Close #543

@kateinoigakukun kateinoigakukun changed the title BridgeJS: Fix Array<@jsclass struct> support on imported interfaces BridgeJS: Fix Array<@JSClass struct> support on imported interfaces Feb 19, 2026
@kateinoigakukun kateinoigakukun force-pushed the fix-swift-class-array branch 2 times, most recently from 265e8fe to b47150e Compare February 19, 2026 16:49
@Amzd
Copy link
Contributor

Amzd commented Feb 19, 2026

enums as spit out by the playground do not compile on this branch

export type Foo = "a" | "b"
export function foo(): Foo

generates:

@JSFunction func foo() throws(JSException) -> Foo

enum Foo: String {
    case a = "a"
    case b = "b"
}
extension Foo: _BridgedSwiftEnumNoPayload, _BridgedSwiftRawValueEnum {}

error: Type 'Foo' does not conform to protocol '_BridgedSwiftStackType'

@Amzd
Copy link
Contributor

Amzd commented Feb 19, 2026

nevermind, fixed with @_spi(BridgeJS) import JavaScriptKit

Base automatically changed from yt/fix-heapobj-ownership to main February 20, 2026 08:46
@krodak krodak merged commit bf69cdb into main Feb 20, 2026
12 checks passed
@krodak krodak deleted the fix-swift-class-array branch February 20, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BridgeJS] Support Array with JSObject and @JSClass struct element types

3 participants