-
-
Notifications
You must be signed in to change notification settings - Fork 61
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Issue
When processing multiple Swift files with @js annotations, BridgeJS fails to resolve type references to classes defined in other files.
// ClassA.swift
@JS class ClassA {
@JS var linkedB: ClassB? // Error triggered here
}
// ClassB.swift
@JS class ClassB {
@JS init() {}
}Error:
// error: Unsupported type: ClassB
Hint: Only primitive types and types defined in the same module are allowedRoot Cause
ExportSwift.addSourceFile() immediately parses each file when called. Type resolution happens during parsing, but typeDeclResolver only knows about types from files already processed, so the process depends on files order, which it shouldn't.
If files are processed in alphabetical order (ClassA.swift before ClassB.swift), ClassA references ClassB before it's registered.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working