File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -1757,5 +1757,10 @@ bool LinkEntity::hasNonUniqueDefinition() const {
1757
1757
return true ;
1758
1758
}
1759
1759
1760
+ // Always treat witness tables as having non-unique definitions.
1761
+ if (getKind () == Kind::ProtocolWitnessTable) {
1762
+ return true ;
1763
+ }
1764
+
1760
1765
return false ;
1761
1766
}
Original file line number Diff line number Diff line change @@ -86,6 +86,25 @@ public func getPointOffsets() -> [Int] {
86
86
enumerateByteOffsets ( Point . self)
87
87
}
88
88
89
+ public class PointClass {
90
+ public var x , y : Int
91
+
92
+ public init ( x: Int , y: Int ) {
93
+ self . x = x
94
+ self . y = y
95
+ }
96
+ }
97
+
98
+ public protocol Reflectable : AnyObject {
99
+ func reflect( )
100
+ }
101
+
102
+ extension PointClass : Reflectable {
103
+ public func reflect( ) {
104
+ swap ( & x, & y)
105
+ }
106
+ }
107
+
89
108
//--- ClientA.swift
90
109
import Root
91
110
@@ -99,6 +118,10 @@ public func getPointAndColorOffsets() -> [Int] {
99
118
getPointOffsets ( ) + enumerateByteOffsets( Color . self)
100
119
}
101
120
121
+ public func getReflectableA( ) -> any AnyObject & Reflectable {
122
+ return PointClass ( x: 5 , y: 5 )
123
+ }
124
+
102
125
//--- ClientB.swift
103
126
import Root
104
127
@@ -112,6 +135,10 @@ public func getExtraPoint3DOffsets() -> [Int] {
112
135
return Array ( point3DOffsets [ pointOffsets. count... ] )
113
136
}
114
137
138
+ public func getReflectableB( ) -> any AnyObject & Reflectable {
139
+ return PointClass ( x: 5 , y: 5 )
140
+ }
141
+
115
142
//--- Application.swift
116
143
import ClientA
117
144
import ClientB
@@ -124,6 +151,7 @@ struct Main {
124
151
print ( pointAndColorOffsets. count)
125
152
print ( extraColor3DOffsets. count)
126
153
154
+ let reflected = [ getReflectableA ( ) , getReflectableB ( ) ]
127
155
// CHECK: DONE
128
156
print ( " DONE " )
129
157
}
You can’t perform that action at this time.
0 commit comments