Undefined symbols compilation error when building in release configuration #2439
vladyslavsosiuk
started this conversation in
General
Replies: 2 comments 1 reply
-
Hi @vladyslavsosiuk, this appears to be a bug in the Swift compiler and not an issue in TCA. I'm moving this to a GitHub discussion, and feel free to continue discussing it there. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Is this a compiler bug? I thought that the types of your internal reducers become part of the type signature for your public reducer’s body therefore the internal reducer types need to be public themselves. You can of course keep the internal reducer’s init function internal so the reducers cannot be used outside of that module. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
When there is a public reducer that uses an internal reducer in its body and compiling in release mode the compiler will throw an error
ld: Undefined symbols:
.There is no error when compiling in Debug mode.
To workaround the issue simply mark the reducer public.
you can find a sample project here:
https://github.com/vladyslavsosiuk/CompilerBug
a link to the internal reducer that causes the error:
https://github.com/vladyslavsosiuk/CompilerBug/blob/d8215426ec7b6c7a5e8b8d897f393bb3080d9b2b/Modules/Sources/Child/Child.swift#L16
the
main
branch represents the issuethe
workaround
branch represents the workaround to get the project compiling in release configurationChecklist
main
branch of this package.Expected behavior
The app compiles without any errors
Actual behavior
The app doesn't compile in Release configuration
Steps to reproduce
The Composable Architecture version information
15acb23
Destination operating system
iOS 17, iOS 16.4
Xcode version information
Xcode 14.3.1, 15 Beta 8
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions