Files
swift-mirror/test/Sema/implementation-only-deprecated.swift
Allan Shortlidge 8ceba34f62 AST: Add a warning group for @_implementationOnly deprecation diagnostics.
This allows developers to control the level of these diagnostics.

Resolves rdar://152735425.
2025-06-06 19:12:32 -07:00

31 lines
1.1 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: split-file %s %t --leading-lines
// RUN: %target-swift-frontend -emit-module %t/Lib.swift \
// RUN: -enable-library-evolution -swift-version 5 \
// RUN: -emit-module-path %t/Lib.swiftmodule
// RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \
// RUN: -enable-library-evolution -swift-version 5 \
// RUN: -verify
// RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \
// RUN: -enable-library-evolution -swift-version 5 \
// RUN: -enable-upcoming-feature InternalImportsByDefault \
// RUN: -verify
// RUN: %target-swift-frontend -typecheck %t/Client.swift -I %t \
// RUN: -enable-library-evolution -swift-version 5 \
// RUN: -enable-upcoming-feature InternalImportsByDefault \
// RUN: -warnings-as-errors -Wwarning ImplementationOnlyDeprecated \
// RUN: -verify
// REQUIRES: swift_feature_InternalImportsByDefault
//--- Lib.swift
public struct SomeType {}
//--- Client.swift
@_implementationOnly import Lib
// expected-warning @-1 {{'@_implementationOnly' is deprecated, use 'internal import' instead}} {{1-21=internal}}
internal func foo(_: SomeType) {}