Cannot used with `struct`
honghaoz opened this issue · comments
HongHao Zhang commented
Seems like I cannot use Then
on struct type:
struct SomeStruct {
var name: String = ""
}
extension SomeStruct : Then {}
var aStruct = SomeStruct().then {
$0.name = "123"
}
$0.name = "123"
line throw an error: ...swift:43:10: Cannot assign to property: '$0' is a 'let' constant
Suyeol Jeon commented
HongHao Zhang commented
great! thanks 👍