BridgeJS resolves unqualified type references relative to their lexical scope, but qualified relative names such as Shelf.Divider are currently treated as root-qualified.
For example:
@JS class Library {
@JS struct Shelf {
@JS struct Divider {
@JS init() {}
}
}
}
extension Library {
@JS func divider(_ value: Shelf.Divider) -> Shelf.Divider {
value
}
}
Swift resolves Shelf.Divider as Library.Shelf.Divider. BridgeJS instead looks for a root-level Shelf.Divider, then silently omits divider(_:) from the generated skeleton.
The same behavior exists before #803, although extension-nested types make it easier to run into. MemberTypeSyntax should search from the innermost lexical scope before falling back to a root-qualified path, matching the existing behavior for IdentifierTypeSyntax.
BridgeJS resolves unqualified type references relative to their lexical scope, but qualified relative names such as
Shelf.Dividerare currently treated as root-qualified.For example:
Swift resolves
Shelf.DividerasLibrary.Shelf.Divider. BridgeJS instead looks for a root-levelShelf.Divider, then silently omitsdivider(_:)from the generated skeleton.The same behavior exists before #803, although extension-nested types make it easier to run into.
MemberTypeSyntaxshould search from the innermost lexical scope before falling back to a root-qualified path, matching the existing behavior forIdentifierTypeSyntax.