Sema: Embedded can reference typealiases to non-publicly imported types

This commit is contained in:
Alexis Laferrière
2025-11-04 11:19:53 -08:00
parent 3fedebfe6c
commit e04dac5523
3 changed files with 9 additions and 1 deletions

View File

@@ -26,6 +26,8 @@ internal func localInternalFunc() {} // expected-note {{global function 'localIn
@_spi(S) public func localSPI() {}
typealias AliasToDirect = StructFromDirect
@inlinable
public func explicitlyInlinable(arg: StructFromDirect = StructFromDirect()) {
// expected-error @-1 {{initializer 'init()' cannot be used in a default argument value because 'directs' was imported implementation-only}}
@@ -82,6 +84,8 @@ public func implicitlyInlinablePublic(arg: StructFromDirect = StructFromDirect()
localSPI()
spiFunctionFromDirect()
let _: AliasToDirect // expected-error {{AliasToDirect' aliases 'directs.StructFromDirect' and cannot be used in an embedded function not marked '@_neverEmitIntoClient' because 'directs' has been imported as implementation-only}}
}
private func implicitlyInlinablePrivate(arg: StructFromDirect = StructFromDirect()) {