Files
swift-mirror/test/ModuleInterface/BackDeployedAttrGood.swiftinterface
Allan Shortlidge 7ea778f3a0 Sema: Diagnose @backDeployed functions with missing bodies in swiftinterfaces.
A `@backDeployed` function printed in a `.swiftinterface` must have a function
body so that SILGen can emit a fallback copy to call when the back deployed
function is unavailable. Previously, the compiler would crash in SILGen when
compiling an interface containing a back deployed function without a body.

Resolves rdar://141593108.
2025-01-03 09:15:12 -08:00

17 lines
510 B
Plaintext

// swift-interface-format-version: 1.0
// swift-module-flags:
// RUN: %target-swift-typecheck-module-from-interface(%s) -module-name Test
// REQUIRES: OS=macosx
// Since the following declarations are only back deployed on iOS, their bodies
// should be missing in a `.swiftinterface` compiled for macOS
@available(iOS 17.4, *)
@backDeployed(before: iOS 18.0)
public func backDeployedFuncOniOSWithoutBody()
@available(iOS 17.4, *)
@backDeployed(before: iOS 18.0)
public var backDeployedVarWithoutBody: Int