Hi there. I have a piece of code-generated code and I don't have an easy way to rename some of the generated entities (this is OpenAPI-generator w/ mustache which is quite limited on purpose).
So to set on a generic problem let's say I have:
protocol P1 {
associatedtype T1
}
protocol P2: P1 {
associatedtype T2
}
Then the code-generated piece I can arrive to looks like:
class C2: P2 {
typealias T2 = Int
}
so I was hoping to be able to express that actually T1 = T2, so I just went with:
extension P2 {
typealias T1 = T2
}
this works (yey!) but now I'm getting a non-actionable warning/suggestion that says:
Typealias overriding associated type 'T1' from protocol 'P1' is better expressed as same-type constraint on the protocol
and the fix it offers is:
remove extension P2
and change P2 definition to protocol P2: P1 where T1 == T2 {
.
but the problem is that this doesn't seem to be arriving to the same effect. as soon as I do that C2 fails with Type 'C2' does not conform to protocol 'P1'
So I was wondering if a) I can mute the warning or b) if there's any other way I could express this. Thanks!
PS: FB13855880