[Pitch] Issue Handling Traits

I have a need for a filtering solution for the library I'm working on, but I'm unsure about making it available as a trait (particularly with an attached function body, which will become part of the @Test macro).

For my use-case, I would need to use this code:

Trait.transformIssues({ issue in
    ... 
}).provideScope(for: Test.current!, testCase: Test.Case.current) {
    ...
}

So I agree with Grynspan that it might be better to make this logic only available as a function.

It seems neater to me if only specific handling implementations were available as Traits, to keep the Test declaration succinct. These additional traits could be written by other 3rd parties using scope providers.

1 Like