Cannot use -enable-objc-interop
on Linux with Foundation
#76247
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
Hello!
We have a Swift class annotated with
@obj
and we would like to expose its methods to Objective-C. The package is built with SPM using the latest Ubuntu 24.04 toolchain:swift-5.10.1-RELEASE-ubuntu20.04
.However, similarly to what happened in #64457, when the flag
-enable-objc-interop
is set, Foundation cannot be used. The building process is interrupted by the error explained down below.Reproduction
mkdir objc-test && cd objc-test && swift package init
.Package.swift
, set the-enable-objc-interop
compiler flag:Sources/objc-test/objc_test.swift
, write the following example code:swift build
on the terminal, and you will get the following error:Expected behavior
Foundation should be usable on Linux when Objective-C interoperability is enabled (i.e., the flag
-enable-objc-interop
is set).Environment
swift --version
:Linux 6.8.0-41-generic #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 2 20:41:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Additional information
No response
The text was updated successfully, but these errors were encountered: