Avatar
Joe_Groff >> anandabits Matthew Johnson
>> These examples require “path-dependent types” to work. There are some examples in the old enhanced existentials draft (although it does not use the term path-dependent types). >> >> Also, fwiw Scala’s type system supports this feature . I don’t know Scala in depth so I’m not sure how closely it relates to what we might have in Swift but you might find it interesting to look at how Scala handles this.
This would be my in-an-ideal-world choice for how existentials eventually work in Swift.
https://forums.swift.org/t/se-0244-opaque-result-types-reopened/22942/53
This would be my in-an-ideal-world choice for how existentials eventually work in Swift.
12:36 AM
代入できるスーパータイプとしての利便性は別途存在するという意味です
この場合でも、↑の value プロパティについて、コードのフローを考慮して同じ型であることが保証できる場合のみ代入できるようにするとか?