Skip to content

Commit ad9373c

Browse files
committed
Remove @_transparent references to allow better backward compatability
Older versions of Xcode that do not allow the hot-swappability of Swift toolchains do not have the definition of @_transparent. The geometry APIs are not fully clear if they are reasonable to live in Foundation in the first place; so in the spirit of compatability we can just remove that attribute for now.
1 parent 4d52227 commit ad9373c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Diff for: Foundation/NSGeometry.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ public struct CGFloat {
1414
/// 32-bit architectures and Double on 64-bit architectures.
1515
/// We assume 64 bit for now
1616
public typealias NativeType = Double
17-
@_transparent public init() {
17+
public init() {
1818
self.native = 0.0
1919
}
20-
@_transparent public init(_ value: Float) {
20+
public init(_ value: Float) {
2121
self.native = NativeType(value)
2222
}
23-
@_transparent public init(_ value: Double) {
23+
public init(_ value: Double) {
2424
self.native = NativeType(value)
2525
}
2626
/// The native value.
@@ -30,11 +30,11 @@ public struct CGFloat {
3030
public struct CGPoint {
3131
public var x: CGFloat
3232
public var y: CGFloat
33-
@_transparent public init() {
33+
public init() {
3434
self.x = CGFloat()
3535
self.y = CGFloat()
3636
}
37-
@_transparent public init(x: CGFloat, y: CGFloat) {
37+
public init(x: CGFloat, y: CGFloat) {
3838
self.x = x
3939
self.y = y
4040
}
@@ -43,11 +43,11 @@ public struct CGPoint {
4343
public struct CGSize {
4444
public var width: CGFloat
4545
public var height: CGFloat
46-
@_transparent public init() {
46+
public init() {
4747
self.width = CGFloat()
4848
self.height = CGFloat()
4949
}
50-
@_transparent public init(width: CGFloat, height: CGFloat) {
50+
public init(width: CGFloat, height: CGFloat) {
5151
self.width = width
5252
self.height = height
5353
}
@@ -56,11 +56,11 @@ public struct CGSize {
5656
public struct CGRect {
5757
public var origin: CGPoint
5858
public var size: CGSize
59-
@_transparent public init() {
59+
public init() {
6060
self.origin = CGPoint()
6161
self.size = CGSize()
6262
}
63-
@_transparent public init(origin: CGPoint, size: CGSize) {
63+
public init(origin: CGPoint, size: CGSize) {
6464
self.origin = origin
6565
self.size = size
6666
}

0 commit comments

Comments
 (0)