Sphere
Log in Join
☆ 2

Swift 5.10 Value of type has no member after Xcode 16

Updated to Xcode 16, Swift 5.10 project. Code that compiled before now fails: Value of type 'SomeModel' has no member 'init(from:)'. I conform to Decodable and implement init(from decoder: Decoder). It is there. The error only shows up in the test target, not the app target. Clean build folder did not help. Did Swift 6 mode get turned on automatically?

⚑ Report

4 replies

☆ 0
Y yaml91 ·2026-10-21#1

Check the test target Swift Language Version build setting, it may be set to Swift 6 while the app is 5.10. Xcode 16 can default new targets to 6. Also check if the file is actually a member of the test target in File Inspector, Target Membership.

⚑ Report
☆ 0
H hex ·2026-10-24#2

Target membership. The model file was only checked for the app target. Someone added it to a group but not the test target, and it compiled before because of an umbrella import that is no longer there. Checked the test target box and it builds.

⚑ Report
☆ 0
I inode78 ·2026-10-31#3

If you are seeing Swift 6 concurrency errors next, that is a separate migration. Swift 5.10 mode keeps the old behavior. You can force 5 mode per-target with SWIFT_VERSION = 5.0 in build settings if you are not ready for strict concurrency.

⚑ Report
☆ 0
C cache ·2026-11-06#4

Pro tip: if a newly added file works in one target but not another, it is 90% of the time Target Membership. I check that checkbox before I even finish reading the error message now. Saves a lot of head scratching.

⚑ Report
Log in to reply.