See the code:

protocol Foo {

    func instance() -> Self

}


class Bar: Foo {

    func instance() -> Self {

        return self // Declaration: let `self`: Self

    }

    func other() {

        let i = self // Declaration: let `self`: Bar

    }

}

How does it happen?


Zhaoxin
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to