Conditional projected property?

Is this supported? I can't test it with the latest Xcode snapshot, it crashes on me.

struct Wrapper<Value> {
  var wrappedValue: Value

extension Wrapper where Value == Int {
  var projectedValue: String {
    return "\(wrappedValue)"

struct S {
  @Wrapper var a = "swift"
  @Wrapper var b = 42
  func foo() {
//    print(self.$a)

let s = S()

cc @Douglas_Gregor

If this is not supported, but should, let me know I'll file a ticket.

@Douglas_Gregor I filed a bug report I have an important use case where I need this feature to work.

Terms of Service

Privacy Policy

Cookie Policy