Property wrapper projectedValue cannot be in a extension?

It appears the $xxx is not synthesized if projectedValue is in an extension?

Xcode 15.2 and Xcode 15.3 have this problem


@propertyWrapper
class Box<A> {
  var wrappedValue: A
  
  init(wrappedValue: A) {
    self.wrappedValue = wrappedValue
  }

  // $ prefix for projected value works here but not in a extension
//  var projectedValue: Reference<A> {
//    Reference<A>(get: { self.wrappedValue }, set: { self.wrappedValue = $0 })
//  }
}

// $ prefix doesn't work: $xxx not found
extension Box {
  var projectedValue: Reference<A> {
    Reference<A>(get: { self.wrappedValue }, set: { self.wrappedValue = $0 })
  }
}


// Projected value
@propertyWrapper
class Reference<A> {
  private var _get: () -> A
  private var _set: (A) -> ()
  
  var wrappedValue: A {
    get { _get() }
    set { _set(newValue) }
  }
  
  init(get: @escaping () -> A, set: @escaping (A) -> ()) {
    _get = get
    _set = set
  }
}

struct Person {
  var name: String
}

struct PersonEditor {
  @Reference var person: Person
}

func makeEditor() -> PersonEditor {
  @Box var person = Person(name: "Chris")
  // if projectedValue implement in a extension
  // Cannot find '$person' in scope
  return PersonEditor(person: $person)
}