Skip to content

Unable to compile on Linux #7

@NuttyShrimp

Description

@NuttyShrimp

Hey,

I'm very interested in this library and want to try it out for my project.
I develop & want to deploy the project on Linux, but was unable to compile the project (as a dependency & just from the root of this repo).
My setup is using the latest swift version as of now, 6.3.1.
The following errors are thrown:

.../ReerJSON/Sources/ReerJSON/JSONDecoderImpl.swift:270:25: error: 'let' binding pattern cannot appear in an expression
 268 |             }
 269 |             return date
 270 |         case .formatted(let formatter):
     |                         `- error: 'let' binding pattern cannot appear in an expression
 271 |             let string = try unboxString(from: value, for: codingPathNode, additionalKey)
 272 |             guard let date = formatter.date(from: string) else {
.../ReerJSON/Sources/ReerJSON/JSONEncoderImpl.swift:286:25: error: 'let' binding pattern cannot appear in an expression
284 |         case .iso8601:
285 |             return wrapString(_iso8601Formatter.string(from: date))
286 |         case .formatted(let formatter):
    |                         `- error: 'let' binding pattern cannot appear in an expression
287 |             return wrapString(formatter.string(from: date))
288 |         case .custom(let closure):

I did some quick digging and found out that the formatted strategy is not implemented in the same place as the others. It needs to be provided by the swift-corelibs-foundation as this depends on the ObjC runtime on MacOS. But for some reason it's not being picked up as an option when running the switch case

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions