Files
swift-mirror/test/Availability/availability_literals_inferred.swift
Allan Shortlidge 897a74f495 Tests: Move some availability tests into a new test/Availability directory.
Un-reverts 9c01ee2c1b.

Also, add myself as a reviewer for more availability related files.

NFC.
2025-06-23 15:57:34 -07:00

22 lines
689 B
Swift

// RUN: %target-typecheck-verify-swift -swift-version 5
// https://github.com/apple/swift/issues/61890
@available(*, unavailable)
struct S: ExpressibleByStringLiteral { // expected-note{{'S' has been explicitly marked unavailable here}}
init(stringLiteral value: String) {}
}
@available(*, unavailable)
typealias StringLiteralType = S
let i = "" // expected-error{{'S' is unavailable}}
@available(*, unavailable)
struct S1<T>: ExpressibleByIntegerLiteral { // expected-note{{'S1' has been explicitly marked unavailable here}}
init(integerLiteral value: Int) {}
}
@available(*, unavailable)
typealias IntegerLiteralType = S1<Int>
let a = 0 // expected-error{{'S1' is unavailable}}