File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,34 @@ extension Nonfinal: Encodable where T: Encodable {}
6363// CHECK-LABEL: // Nonfinal<A>.encode(to:)
6464// CHECK-NEXT: sil hidden [ossa] @$s29synthesized_conformance_class8NonfinalCAASERzlE6encode2toys7Encoder_p_tKF : $@convention(method) <T where T : Encodable> (@in_guaranteed Encoder, @guaranteed Nonfinal<T>) -> @error Error {
6565
66+ final class FinalHashableClass : Hashable {
67+ static func == ( lhs: FinalHashableClass , rhs: FinalHashableClass ) -> Bool {
68+ return false
69+ }
70+
71+ func hash( into: inout Hasher ) { }
72+ }
73+
74+ // CHECK-LABEL: sil hidden [ossa] @$s29synthesized_conformance_class4doItySiAA18FinalHashableClassCF : $@convention(thin) (@guaranteed FinalHashableClass) -> Int {
75+ // CHECK: bb0(%0 : @guaranteed $FinalHashableClass):
76+ // CHECK: [[FN:%.*]] = function_ref @$s29synthesized_conformance_class18FinalHashableClassC9hashValueSivg : $@convention(method) (@guaranteed FinalHashableClass) -> Int
77+ // CHECK-NEXT: [[RESULT:%.*]] = apply [[FN]](%0) : $@convention(method) (@guaranteed FinalHashableClass) -> Int
78+ // CHECK-NEXT: return [[RESULT]] : $Int
79+
80+ func doIt( _ c: FinalHashableClass ) -> Int {
81+ return c. hashValue
82+ }
83+
84+ // VTable for FinalHashableClass
85+ //
86+ // Note: we should not be emitting a vtable entry for the synthesized
87+ // FinalHashableClass.hashValue getter!
88+
89+ // CHECK: sil_vtable FinalHashableClass {
90+ // CHECK-NEXT: #FinalHashableClass.init!allocator.1: (FinalHashableClass.Type) -> () -> FinalHashableClass : @$s29synthesized_conformance_class18FinalHashableClassCACycfC
91+ // CHECK-NEXT: #FinalHashableClass.deinit!deallocator.1: @$s29synthesized_conformance_class18FinalHashableClassCfD
92+ // CHECK-NEXT: }
93+
6694// Witness tables for Final
6795
6896// CHECK-LABEL: sil_witness_table hidden <T where T : Encodable> Final<T>: Encodable module synthesized_conformance_class {
You can’t perform that action at this time.
0 commit comments