Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Redundant constrant on Transformer #90

Open
swgamerx opened this issue Jan 4, 2021 · 2 comments
Open

Warning: Redundant constrant on Transformer #90

swgamerx opened this issue Jan 4, 2021 · 2 comments

Comments

@swgamerx
Copy link

swgamerx commented Jan 4, 2021

Describe the bug
Getting a compile warning on Attribute.swift on line 39 for extension TransformedAttribute "Redundant conformance constraint 'Transformer' : 'Transformer'.

Platform (only for runtime bugs):
MacOS 11.0.1
Xcode 12.2

Context
JSONAPI is included and installed as a CocoaPod but not imported or used in code, just having it available throws the warning.

Do you plan to fix yourself?
I might but It's a bit beyond my understanding at the moment.

@mattpolzin
Copy link
Owner

mattpolzin commented Jan 6, 2021

This is an annoying warning that showed up some time ago (via a new Swift version, I forget which one) and has changed a bit with each new Swift version but never gone away.

I am not really sure how else to formulate the line it warns about; the line in question is not simply redeclaring conformance to Transformer, but rather further specializing to Transformer specifically being equal to IdentityTransformer.

If you find another way to write the code, let me know! The only thing I have come up with is using Transformer.From == Transformer.To instead of Transformer == IdentityTransformer<RawValue> but that has a different meaning and although it might work almost as well, I don't want to bet that on a minor patch that fixes a warning but might actually cause a regression for someone else's code.

@swgamerx
Copy link
Author

I assumed it must be related to some XCode changes or the newer version of Swift, I just thought It might be worth documenting even though it's just a warning. I'll take a swing at it but you understand it 1000x more than I do, but it could be a good learning experiencing to dig around it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants