mattpolzin / JSONAPI

Swift Codable JSON:API framework
MIT License
75 stars 19 forks source link

Unable to Compile using Xcode 12.5 beta1 #92

Closed denizak closed 3 years ago

denizak commented 3 years ago

Describe the bug JSONAPI/Sources/JSONAPI/Resource/Resource Object/ResourceObject+Replacing.swift:18:25: Value of type 'ResourceObject<Description, MetaType, LinksType, EntityRawIdType>' has no dynamic member 'id' using key path from root type 'ResourceObject<Description, MetaType, LinksType, EntityRawIdType>.Description.Attributes'

Platform (only for runtime bugs): iOS

Context I try to compile this repo with master branch.

mattpolzin commented 3 years ago

Thanks for the bug report! This looks like a bug with the current beta release of the Swift compiler.

I've briefly looked over the known issues for Swift 5.4 and did not spot any reason for this bug, but I am also fairly confident Swift 5.4 did not intentionally change anything that would break the code in question.

I've seen issues with compiling this library in the past resolve in the 2nd or 3rd betas of Xcode. This library uses dynamic member lookup and type constraints heavily and both have been the victim of early beta compiler bugs before.

At this point, I will leave this ticket open and revisit after the next Xcode beta is released.

If you or anyone else has time to take the code that is not compiling here and reduce it down to a good bug report for Apple I know they would appreciate seeing a report for this bug!

mattpolzin commented 3 years ago

Release 5.0.1 fixes this problem. https://github.com/mattpolzin/JSONAPI/releases/tag/5.0.1

Thanks for the ticket!