Modifying default traits (original) (raw)

Package traits are a welcome addition to SPM!

When using a package with numerous traits enabled by default it seems a common use case would be to use the defaults minus one or two traits.

Without understanding how traits are implemented I tried something like this:

dependencies: [
    .package(
        url: "https://...",
        from: "x.y.z"
        traits: Set([.defaults])
            .subtracting([
                "SOME_TRAIT_I_DONT_WANT",
            ])
    )
],

The code compiles but does not work as expected- the default traits are used without any changes.

Is there a way as a package consumer to use a modified set of a package's default traits without the need to repeat all of them?