Skip to content

ISO8601DateFormatter.Options should have immutable static properties #4703

@fumoboy007

Description

@fumoboy007

ISO8601DateFormatter.Options uses var for its static properties. The properties should instead be declared using let to prevent accidental mutation and to let the compiler know that these properties are concurrency-safe.

Regarding the latter point, the following is an example error caused by this issue:

error: reference to static property 'withInternetDateTime' is not concurrency-safe because it involves shared mutable state

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