Replace dynamic type checks with generic overloads #41
Labels
area/runtime
Affects: the runtime library.
kind/enhancement
Improvements to existing feature.
size/S
Small task. (A couple of hours of work.)
A recent PR to the runtime library was fixing an issue for the transcoding of types that have an additional protocol conformance. This was done with a dynamic
as?
type check and anas!
force cast.In a comment, we discussed a better way: using a specialization and letting the compiler do the work: apple/swift-openapi-runtime#9 (comment).
We approved the PR as-was because it matched the pattern we were using in the rest of the code base and was a targeted fix for an issue.
This issue is to track revisiting the dynamic type checking pattern in all the places its used in the runtime library and adopting the pattern in the linked PR comment.
The text was updated successfully, but these errors were encountered: