apple / apple/swift-configuration

Automatic support in `ExpressibleByConfigInt` for `RawRepresentable` enums with other integer `RawValue` types

Open
#205 3 comments 0 reactions 0 assignees View on GitHub
kind/enhancement status/needs-design
Dominant language
Swift
Stars
811
Forks
60
Avg merge
9h 38m
Merged PRs (30d)
6

Description

From the docs:

> If your type is an integer-based enum, you don’t need to explicitly conform it to [`ExpressibleByConfigInt`](https://swiftpackageindex.com/apple/swift-configuration/1.2.0/documentation/configuration/expressiblebyconfigint), as the same conversions work for types that conform to `RawRepresentable` with an `Int` raw value automatically.

However, this does not apply to `RawRepresentable` enums with other kinds of integer raw values (`UInt8`, `UInt16`, etc.), and IMO it would be very useful if it did, as those types are frequently used in networking code for example.

Contributor guide

Open the contributing guide

Research direction

Start with the ExpressibleByConfigInt documentation and the existing conversion path for RawRepresentable types with Int raw values. Locate the related implementation and tests, then cover enums using UInt8, UInt16, and other integer RawValue types; done means those conversions work automatically without explicit ExpressibleByConfigInt conformance.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
backend-api-design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.