Hello community! I' wondering if somebody can explain this to me.
Please take look at the snippet.

protocol P {}
struct X:P {}

func foo<A:P>(_ x:A) {}

func bar() {
    //let x = X() // this compiles
    let x = X() as P // this does not compile. Why?

I expect the both cases to work though. But only first works? And I do not
understand why.
My coworkers said that it is a compiler bug, but I'm not shure it is.
Thanks for the help.
swift-users mailing list

Reply via email to