Files
swift-mirror/test/IRGen/extended_existential_metadata.swift
Slava Pestov 563ebdeb93 IRGen: Try harder not to emit calls to swift_getExtendedExistentialTypeMetadata()
This entry point doesn't exist on older runtimes. Sema enforces
that constrained existentials don't appear in substitution maps,
however IRGen would sometimes try to instantiate metadata even
if the user didn't do that.

Fixes #64657.
2023-04-18 14:11:07 -04:00

23 lines
460 B
Swift

// RUN: %target-swift-frontend -emit-ir %s | %FileCheck %s
// RUN: %target-swift-frontend -emit-ir -O %s | %FileCheck %s
protocol Foo<T> {
associatedtype T
func acceptEvent<T>(event: T)
}
protocol FooFactory<T> {
associatedtype T
func makeFoo() -> any Foo<T>
}
class Bar<T> {
private var foo: (any Foo<T>)
init(fooFactory: any FooFactory<T>) {
self.foo = fooFactory.makeFoo()
}
}
// CHECK-NOT: swift_getExtendedExistentialTypeMetadata