Files
swift-mirror/test/SILGen/dynamic_self_substitution.swift
2025-09-09 18:58:09 -04:00

30 lines
352 B
Swift

// RUN: %target-swift-emit-silgen %s
class C {
func f1() -> Self? {
return D<Self>().g(self)
}
func f2() -> Self? {
return D<Self>()[self]
}
func f3() -> Self? {
return D<Self>().x
}
}
class D<T> {
func g(_ t: T) -> T? {
return t
}
subscript(_ t: T) -> T? {
return t
}
var x: T? {
fatalError()
}
}