mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
These also have to delegate to another initializer even though there are no stored properties to initialize.
44 lines
605 B
Swift
44 lines
605 B
Swift
public struct Point {
|
|
public var x, y: Double
|
|
|
|
public init(x: Double, y: Double) {
|
|
self.x = x
|
|
self.y = y
|
|
}
|
|
}
|
|
|
|
public struct ImmutablePoint {
|
|
public let x, y: Double
|
|
|
|
public init(x: Double, y: Double) {
|
|
self.x = x
|
|
self.y = y
|
|
}
|
|
}
|
|
|
|
public struct GenericPoint<T> {
|
|
public var x, y: T
|
|
|
|
public init(x: T, y: T) {
|
|
self.x = x
|
|
self.y = y
|
|
}
|
|
}
|
|
|
|
public struct PrivatePoint {
|
|
private var x, y: Double
|
|
|
|
public init(x: Double, y: Double) {
|
|
self.x = x
|
|
self.y = y
|
|
}
|
|
}
|
|
|
|
public struct Empty {
|
|
public init() {}
|
|
}
|
|
|
|
public struct GenericEmpty<T> {
|
|
public init() {}
|
|
}
|