Compiler bug with generic args

I got this error today in Xcode 11.4. This seems like a compiler bug:

'P.KP' cannot be a subclass of both 'PartialKeyPath<Property.Root>' and 'WritableKeyPath<Property.Root, Property.Value>'

This seems wrong, because WritableKeyPath inherits from KeyPath, which inherits from PartialKeyPath. By definition then, any subclass of WritableKeyPath is a subclass of PartialKeyPath... so what am I missing here? Even considering the generic aspects, surely PartialKeyPath<Root> is a parent class of WritableKeyPath<Root, Value> when the roots are identical.

This also happens on Xcode 11.3 and 10.3. Let me know if this is a bug so I can report it if so. Otherwise perhaps someone can enlighten me as to why the protocols should compile without any errors, but meanwhile when you try to use them, the compiler won't let you.

Here is the underlying code:

protocol AnyPropertyProtocol {
    associatedtype Root = Any
    associatedtype Value = Any
    associatedtype KP: AnyKeyPath
    var key: KP { get }
    var value: Value { get }
}

protocol PartialPropertyProtocol: AnyPropertyProtocol
where KP: PartialKeyPath<Root> {
}

protocol PropertyProtocol: PartialPropertyProtocol
where KP: WritableKeyPath<Root, Value> {
}

extension Dictionary where Value: AnyPropertyProtocol {
    subscript<R, V, P>(key: Key, path: WritableKeyPath<R, V>) -> P? where P: PropertyProtocol, P.Root == R, P.Value == V {
        return self[key] as? P
    }
}

The error is thrown on the subscript declaration.

Meanwhile the protocol declarations compile just fine.

Fixed the compiler error by changing that line to this:

subscript<P: PropertyProtocol>(key: Key, path: P.KP) -> P?

I think that proves that the error is definitely a compiler bug though, because these say the same thing.

Will do a bug report.