Files
swift-mirror/test/IRGen/dependent_reabstraction.swift
Anthony Latsis b5aec4cc34 [test] Remove pre-rebranch nocapture matches
These were added in https://github.com/swiftlang/swift/pull/81375 (and
several other follow-up PRs because we missed a few places) and
are no longer needed.
2025-10-24 02:07:22 +01:00

27 lines
595 B
Swift

// RUN: %target-swift-frontend -emit-ir %s | %FileCheck %s
func markUsed<T>(_ t: T) {}
protocol A {
associatedtype B
func b(_: B)
}
struct X<Y> : A {
// CHECK-LABEL: define internal swiftcc void @"$s23dependent_reabstraction1XVyxGAA1AA2aEP1byy1BQzFTW"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias swiftself captures(none) %1, ptr %Self, ptr %SelfWitnessTable)
func b(_ b: X.Type) {
let x: Any = b
markUsed(b as X.Type)
}
}
func foo<T: A>(_ x: T, _ y: T.B) {
x.b(y)
}
let a = X<Int>()
let b = X<String>()
foo(a, X<Int>.self)
foo(b, X<String>.self)