SILLinker: make sure to de-serialize base protocol witness tables in embedded mode

Fixes unresolved symbol linker errors or compiler crashes
rdar://148538336
This commit is contained in:
Erik Eckstein
2025-04-04 10:04:06 +02:00
parent b850395611
commit e68882e8a3
2 changed files with 11 additions and 2 deletions

View File

@@ -9,7 +9,11 @@
// BEGIN MyModule.swift
public protocol ClassBound: AnyObject {
public protocol Base: AnyObject {
func bar()
}
public protocol ClassBound: Base {
func foo()
}
@@ -18,6 +22,7 @@ class MyGenericClass<T> {
init(typ: String) { self.typ = typ }
}
extension MyGenericClass: ClassBound {
func bar() { print("MyGenericClass<\(typ)>.bar()") }
func foo() { print("MyGenericClass<\(typ)>.foo()") }
}
@@ -32,3 +37,5 @@ import MyModule
var arr: [any ClassBound] = [factory()]
arr[0].foo()
// CHECK: MyGenericClass<String>.foo()
arr[0].foo()
// CHECK: MyGenericClass<String>.bar()