You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@frozen // expected-error {{'@frozen' attribute can only be applied to '@usableFromInline', package, or public declarations, but 'FrozenInternalStruct' is internal}} {{1-9=}}
25
+
structFrozenInternalStruct{
26
+
varone:Int
27
+
vartwo:String
28
+
func f(){}
29
+
}
30
+
31
+
@_fixed_layout
32
+
packageclassFixedPkgKlass{
33
+
packagevarone:Int=1
34
+
packagevartwo:String=""
35
+
packagefunc f(){}
36
+
}
37
+
38
+
@_fixed_layout // expected-error {{'@_fixed_layout' attribute can only be applied to '@usableFromInline', package, or public declarations, but 'FixedInternalKlass' is internal}} {{1-16=}}
switch arg { // expected-warning {{switch covers known cases, but 'UfiPkgEnum' may have additional unknown values}} {{none}} expected-note {{handle unknown values using "@unknown default"}}
53
141
case.one:
@@ -80,8 +168,8 @@ public func k(_ arg: FrozenPublicEnum) -> Int {
80
168
import Utils
81
169
82
170
// With optimization enabled to bypass resilience checks within
83
-
// a package boundary, public (non-frozen) or package enums no
84
-
// longer require `@unknown default` in source code switch stmts.
171
+
// a package boundary, public (non-frozen) or package (non-frozen)
172
+
// enums no longer require `@unknown default` in switch stmts.
// expected-error@-1 {{'@frozen' attribute can only be applied to '@usableFromInline' or public declarations, but 'InternalStruct' is internal}}
72
+
// expected-error@-1 {{'@frozen' attribute can only be applied to '@usableFromInline', package, or public declarations, but 'InternalStruct' is internal}}
// expected-error@-1 {{'@_fixed_layout' attribute can only be applied to '@usableFromInline' or public declarations, but 'FixedInternalStruct' is internal}}
78
+
// expected-error@-1 {{'@_fixed_layout' attribute can only be applied to '@usableFromInline', package, or public declarations, but 'FixedInternalStruct' is internal}}
79
79
// expected-warning@-2 {{'@frozen' attribute is now used for fixed-layout structs}}
80
80
81
81
@_fixed_layoutpublicstructNestedStruct{}
82
82
// expected-warning@-1 {{'@frozen' attribute is now used for fixed-layout structs}}
83
83
}
84
84
85
85
@frozenfileprivatestructFileprivateStruct{}
86
-
// expected-error@-1 {{'@frozen' attribute can only be applied to '@usableFromInline' or public declarations, but 'FileprivateStruct' is fileprivate}}
86
+
// expected-error@-1 {{'@frozen' attribute can only be applied to '@usableFromInline', package, or public declarations, but 'FileprivateStruct' is fileprivate}}
// expected-error@-1 {{'@_fixed_layout' attribute can only be applied to '@usableFromInline' or public declarations, but 'FixedFileprivateStruct' is fileprivate}}
89
+
// expected-error@-1 {{'@_fixed_layout' attribute can only be applied to '@usableFromInline', package, or public declarations, but 'FixedFileprivateStruct' is fileprivate}}
90
90
// expected-warning@-2 {{'@frozen' attribute is now used for fixed-layout structs}}
// expected-error@-1 {{'@frozen' attribute can only be applied to '@usableFromInline' or public declarations, but 'PrivateStruct' is private}}
93
+
// expected-error@-1 {{'@frozen' attribute can only be applied to '@usableFromInline', package, or public declarations, but 'PrivateStruct' is private}}
// expected-error@-1 {{'@_fixed_layout' attribute can only be applied to '@usableFromInline' or public declarations, but 'FixedPrivateStruct' is private}}
96
+
// expected-error@-1 {{'@_fixed_layout' attribute can only be applied to '@usableFromInline', package, or public declarations, but 'FixedPrivateStruct' is private}}
97
97
// expected-warning@-2 {{'@frozen' attribute is now used for fixed-layout structs}}
Copy file name to clipboardExpand all lines: test/attr/attr_inlinable.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ public struct Struct {
109
109
110
110
@inlinable
111
111
privatefunc privateInlinableMethod(){
112
-
// expected-error@-2 {{'@inlinable' attribute can only be applied to public declarations, but 'privateInlinableMethod' is private}}
112
+
// expected-error@-2 {{'@inlinable' attribute can only be applied to internal, package, or public declarations, but 'privateInlinableMethod' is private}}
113
113
structNested{}
114
114
// expected-error@-1 {{type 'Nested' cannot be nested inside an '@inlinable' function}}
115
115
}
@@ -326,7 +326,7 @@ extension P {
326
326
327
327
// rdar://problem/60605117
328
328
publicstructPrivateInlinableCrash{
329
-
@inlinable // expected-error {{'@inlinable' attribute can only be applied to public declarations, but 'formatYesNo' is private}}
329
+
@inlinable // expected-error {{'@inlinable' attribute can only be applied to internal, package, or public declarations, but 'formatYesNo' is private}}
0 commit comments