File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -2957,7 +2957,7 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
2957
2957
}
2958
2958
2959
2959
case DAK_StorageRestrictions: {
2960
- auto abbrCode = S.DeclTypeAbbrCodes [AccessesDeclAttrLayout ::Code];
2960
+ auto abbrCode = S.DeclTypeAbbrCodes [StorageRestrictionsDeclAttrLayout ::Code];
2961
2961
auto attr = cast<StorageRestrictionsAttr>(DA);
2962
2962
2963
2963
SmallVector<IdentifierID, 4 > properties;
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %empty-directory(%t/src)
3
+ // RUN: %empty-directory(%t/sdk)
4
+ // RUN: split-file %s %t/src
5
+
6
+ // REQUIRES: asserts
7
+
8
+ // RUN: %target-swift-frontend -emit-module %t/src/PublicModule.swift \
9
+ // RUN: -module-name PublicModule -swift-version 5 \
10
+ // RUN: -emit-module-path %t/sdk/PublicModule.swiftmodule \
11
+ // RUN: -enable-experimental-feature InitAccessors
12
+
13
+ // RUN: %target-swift-frontend -typecheck %t/src/Client.swift \
14
+ // RUN: -enable-experimental-feature InitAccessors \
15
+ // RUN: -module-name Client -I %t/sdk
16
+
17
+ //--- PublicModule.swift
18
+ public struct Test < T> {
19
+ private var _x : T
20
+
21
+ public var x : T {
22
+ @storageRestrictions ( initializes: _x)
23
+ init {
24
+ _x = newValue
25
+ }
26
+
27
+ get { _x }
28
+ set { _x = newValue }
29
+ }
30
+
31
+ public init ( data: T ) {
32
+ self . x = data
33
+ }
34
+ }
35
+
36
+ //--- Client.swift
37
+ import PublicModule
38
+
39
+ let test = Test < [ Int ] > ( data: [ 1 , 2 , 3 ] )
40
+ _ = test. x
You can’t perform that action at this time.
0 commit comments