Skip to content

Proposal: make FHIRPrimitiveType inherit Sendable #38

@lukaskollmer

Description

@lukaskollmer

i'd like to propose the FHIRPrimitiveType protocol be rewritten to the following:

public protocol FHIRPrimitiveType: FHIRType, Sendable, SendableMetatype {}

(it is currently defined to inherit just from FHIRType.)

since all types that conform to FHIRPrimitiveType are, as the name already suggests, "primitive" types, they will all trivially be able to conform to Sendable.

in fact, all types conforming to FHIRPrimitiveType currently already are capable of being Sendable (though only some of them actually state this as an explicit conformance; changing all six definitions of FHIRPrimitiveType (across the different targets) to the definition above does not require any additional changes to keep the package compiling, and all tests continue to pass without issues.

additionally, as part of this change, we should also add a SendableMetatype conformance, to make it easier to use these types in generic contexts.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions