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
Copy file name to clipboardExpand all lines: test/decl/protocol/conforms/nscoding.swift
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -18,14 +18,14 @@ class CodingA : NSObject, NSCoding {
18
18
extensionCodingA{
19
19
classNestedA:NSObject,NSCoding{ // expected-error{{nested class 'CodingA.NestedA' has an unstable name when archiving via 'NSCoding'}}
20
20
// expected-note@-1{{for new classes, add '@objc' to specify a unique, prefixed Objective-C runtime name}}{{3-3=@objc(<#Objective-C class name#>)}}
21
-
// expected-note@-2{{for compatibility with existing archives, use '@NSKeyedArchiveLegacy' to record the Swift 3 mangled name}}{{3-3=@NSKeyedArchiveLegacy("<#class archival name#>")}}
21
+
// expected-note@-2{{for compatibility with existing archives, use '@NSKeyedArchiveLegacy' to record the Swift 3 mangled name}}{{3-3=@NSKeyedArchiveLegacy("_TtCC8nscoding7CodingA7NestedA")}}
22
22
requiredinit(coder:NSCoder){}
23
23
func encode(coder:NSCoder){}
24
24
}
25
25
26
26
classNestedB:NSObject{
27
27
// expected-note@-1{{for new classes, add '@objc' to specify a unique, prefixed Objective-C runtime name}}{{3-3=@objc(<#Objective-C class name#>)}}
28
-
// expected-note@-2{{for compatibility with existing archives, use '@NSKeyedArchiveLegacy' to record the Swift 3 mangled name}}{{3-3=@NSKeyedArchiveLegacy("<#class archival name#>")}}
28
+
// expected-note@-2{{for compatibility with existing archives, use '@NSKeyedArchiveLegacy' to record the Swift 3 mangled name}}{{3-3=@NSKeyedArchiveLegacy("_TtCC8nscoding7CodingA7NestedB")}}
classCodingB<T>:NSObject,NSCoding{ // expected-error{{generic class 'CodingB<T>' has an unstable name when archiving via 'NSCoding'}}
54
-
// expected-note@-1{{generic classes should not be archived directly}}{{1-1=@NSKeyedArchiveSubclassesOnly}}
54
+
// expected-note@-1{{generic class 'CodingB<T>' should not be archived directly}}{{1-1=@NSKeyedArchiveSubclassesOnly}}
55
55
requiredinit(coder:NSCoder){}
56
56
func encode(coder:NSCoder){}
57
57
}
58
58
59
59
extensionCodingB{
60
60
classNestedA:NSObject,NSCoding{ // expected-error{{generic class 'CodingB<T>.NestedA' has an unstable name when archiving via 'NSCoding'}}
61
-
// expected-note@-1{{generic classes should not be archived directly}}{{3-3=@NSKeyedArchiveSubclassesOnly}}
61
+
// expected-note@-1{{generic class 'CodingB<T>.NestedA' should not be archived directly}}{{3-3=@NSKeyedArchiveSubclassesOnly}}
62
62
requiredinit(coder:NSCoder){}
63
63
func encode(coder:NSCoder){}
64
64
}
@@ -67,15 +67,15 @@ extension CodingB {
67
67
// Fileprivate classes.
68
68
fileprivateclassCodingC:NSObject,NSCoding{ // expected-error{{fileprivate class 'CodingC' has an unstable name when archiving via 'NSCoding'}}
69
69
// expected-note@-1{{for new classes, add '@objc' to specify a unique, prefixed Objective-C runtime name}}{{1-1=@objc(<#Objective-C class name#>)}}
70
-
// expected-note@-2{{for compatibility with existing archives, use '@NSKeyedArchiveLegacy' to record the Swift 3 mangled name}}{{1-1=@NSKeyedArchiveLegacy("<#class archival name#>")}}
70
+
// expected-note@-2{{for compatibility with existing archives, use '@NSKeyedArchiveLegacy' to record the Swift 3 mangled name}}{{1-1=@NSKeyedArchiveLegacy("_TtC8nscodingP33_0B4E7641C0BD1F170280EEDD0D0C1F6C7CodingC")}}
71
71
requiredinit(coder:NSCoder){}
72
72
func encode(coder:NSCoder){}
73
73
}
74
74
75
75
// Private classes
76
76
privateclassCodingD:NSObject,NSCoding{ // expected-error{{private class 'CodingD' has an unstable name when archiving via 'NSCoding'}}
77
77
// expected-note@-1{{for new classes, add '@objc' to specify a unique, prefixed Objective-C runtime name}}{{1-1=@objc(<#Objective-C class name#>)}}
78
-
// expected-note@-2{{for compatibility with existing archives, use '@NSKeyedArchiveLegacy' to record the Swift 3 mangled name}}{{1-1=@NSKeyedArchiveLegacy("<#class archival name#>")}}
78
+
// expected-note@-2{{for compatibility with existing archives, use '@NSKeyedArchiveLegacy' to record the Swift 3 mangled name}}{{1-1=@NSKeyedArchiveLegacy("_TtC8nscodingP33_0B4E7641C0BD1F170280EEDD0D0C1F6C7CodingD")}}
classLocalCoding:NSObject,NSCoding{ // expected-error{{local class 'LocalCoding' has an unstable name when archiving via 'NSCoding'}}
86
86
// expected-note@-1{{for new classes, add '@objc' to specify a unique, prefixed Objective-C runtime name}}{{3-3=@objc(<#Objective-C class name#>)}}
87
-
// expected-note@-2{{for compatibility with existing archives, use '@NSKeyedArchiveLegacy' to record the Swift 3 mangled name}}{{3-3=@NSKeyedArchiveLegacy("<#class archival name#>")}}
87
+
// expected-note@-2{{for compatibility with existing archives, use '@NSKeyedArchiveLegacy' to record the Swift 3 mangled name}}{{3-3=@NSKeyedArchiveLegacy("_TtCF8nscoding12someFunctionFT_T_L_11LocalCoding")}}
88
88
requiredinit(coder:NSCoder){}
89
89
func encode(coder:NSCoder){}
90
90
}
91
91
}
92
92
93
93
// Inherited conformances.
94
94
classCodingE<T>:CodingB<T>{ // expected-error{{generic class 'CodingE<T>' has an unstable name when archiving via 'NSCoding'}}
95
-
// expected-note@-1{{generic classes should not be archived directly}}{{1-1=@NSKeyedArchiveSubclassesOnly}}
95
+
// expected-note@-1{{generic class 'CodingE<T>' should not be archived directly}}{{1-1=@NSKeyedArchiveSubclassesOnly}}
0 commit comments