Decodable, protocol conformance, and generics: how to "dumb down" a conforming type to call the right implementation

To further note, the details of property wrapper is described in SE-0258, which is accepted with modification.

It also support certain initialization syntax such as.

@Migratable(arg2: value2, arg3: value3) var foo: Int = 3
// Equivalent to
// var _foo = Migratable(wrappedValue: 3, arg2: value2, arg3: value3)

@Migratable var foo: Bar = Bar(...)
// var _foo = Migratable(wrappedValue: Bar(...))

So if you want any of that, you can customarily add init.

1 Like