public struct Style {
public var test : Int?
public init(_ build:(Style) -> Void) {
build(self)
}
}
var s = Style { value in
value.test = 1
}
gives an error at the declaration of the variable
Cannot find an initializer for type 'Style' that accepts an argument list of type '((_) -> _)'
Does anyone know why this won't work, it seems legit code to me
for the record this won't work either
var s = Style({ value in
value.test = 1
})