Currently, Swift can infer the type from .init followed by an argument list, like in line 9 below.
I think it would be natural, useful and non-problematic if we could skip the .init part, like in line 10 below (in contexts where it makes sense of course, ie where the .init(...) form is currently accepted).
Example:
struct Point {
let x, y : Double
}
struct Circle {
let center: Point
let radius: Double
}
let a = Circle(center: Point(x: 1, y: 2), radius: 3) // OK
let b = Circle(center: .init(x: 1, y: 2), radius: 3) // OK
let c = Circle(center: (x: 1, y: 2), radius: 3) // Error, but couldn't it be OK as long as the tuple matches the argument list for an initializer of the expected type?There are of course better real world examples where the benefit (of higher signal to noise ratio) is more obvious, but I wanted to keep the example simple.
What do you think?