Skip to content

Conversation

egorzhdan
Copy link
Contributor

This enables the use of reference-counted foreign reference types on Windows. As it turns out, the assertion that was failing on Windows previously was unnecessary. This also enabled many of the tests on Windows.

rdar://154694125 / resolves #82643

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Aug 19, 2025
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/frt-windows branch from 8e38513 to ee18bb8 Compare August 19, 2025 16:01
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan marked this pull request as ready for review August 19, 2025 16:06
@hnrklssn
Copy link
Contributor

When is this metadata needed?

@egorzhdan
Copy link
Contributor Author

@hnrklssn this is only used when compiling for platforms that use COFF, hence the Windows exclusion that this patch removes.

// PE/COFF cannot deal with the cross-module reference to the metadata parent
// (e.g. NativeObject). Force the lazy initialization of the VWT always.
Opts.LazyInitializeClassMetadata = Triple.isOSBinFormatCOFF();

This enables the use of reference-counted foreign reference types on Windows. As it turns out, the assertion that was failing on Windows previously was unnecessary. This also enabled many of the tests on Windows.

rdar://154694125 / resolves swiftlang#82643
@egorzhdan egorzhdan force-pushed the egorzhdan/frt-windows branch from ee18bb8 to b440c4f Compare August 20, 2025 11:35
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test macOS

@compnerd compnerd added the Windows Platform: Windows label Aug 20, 2025
@egorzhdan egorzhdan merged commit ed70a1b into swiftlang:main Aug 21, 2025
3 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/frt-windows branch August 21, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ interop Feature: Interoperability with C++ Windows Platform: Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metadata for C++ foreign reference types on Windows isn't emitted

4 participants