1- // Fixed-layout struct
21package struct Point {
32 package var x : Int // read-write stored property
43 package let y : Int // read-only stored property
@@ -12,7 +11,6 @@ package struct Point {
1211 package mutating func mutantMethod( ) { }
1312}
1413
15- // Resilient-layout struct
1614package struct Size {
1715 package var w : Int // should have getter and setter
1816 package let h : Int // getter only
@@ -26,7 +24,6 @@ package struct Size {
2624 package mutating func mutantMethod( ) { }
2725}
2826
29- // Fixed-layout struct with resilient members
3027package struct Rectangle {
3128 package let p : Point
3229 package let s : Size
@@ -119,3 +116,66 @@ package struct UnavailableResilientInt {
119116 self . i = i
120117 }
121118}
119+
120+
121+ public struct PublicPoint {
122+ public var x : Int // read-write stored property
123+ public let y : Int // read-only stored property
124+
125+ public init ( x: Int , y: Int ) {
126+ self . x = x
127+ self . y = y
128+ }
129+
130+ public func method( ) { }
131+ public mutating func mutantMethod( ) { }
132+ }
133+
134+ @frozen
135+ public struct FrozenPublicPoint {
136+ public var x : Int // read-write stored property
137+ public let y : Int // read-only stored property
138+
139+ public init ( x: Int , y: Int ) {
140+ self . x = x
141+ self . y = y
142+ }
143+
144+ public func method( ) { }
145+ public mutating func mutantMethod( ) { }
146+ }
147+
148+ public struct PublicSize {
149+ public var w : Int // should have getter and setter
150+ public let h : Int // getter only
151+
152+ public init ( w: Int , h: Int ) {
153+ self . w = w
154+ self . h = h
155+ }
156+
157+ public func method( ) { }
158+ public mutating func mutantMethod( ) { }
159+ }
160+
161+ @frozen
162+ public struct FrozenPublicSize {
163+ public var w : Int // should have getter and setter
164+ public let h : Int // getter only
165+
166+ public init ( w: Int , h: Int ) {
167+ self . w = w
168+ self . h = h
169+ }
170+
171+ public func method( ) { }
172+ public mutating func mutantMethod( ) { }
173+ }
174+
175+ public struct PublicResilientInt {
176+ public let i : Int
177+
178+ public init ( i: Int ) {
179+ self . i = i
180+ }
181+ }
0 commit comments