Files
swift-mirror/test/Availability/value_generics_availability.swift
Allan Shortlidge cdebf2bea8 AST: Update 6.2 runtime OS versions.
Swift 6.2 is aligned with the version 26 of each of Apple's operating systems
and the runtime availability metadata should reflect this.
2025-08-05 13:37:38 -07:00

15 lines
797 B
Swift

// RUN: %target-typecheck-verify-swift
// REQUIRES: OS=macosx
struct A<let N: Int> {} // expected-error {{values in generic types are only available in macOS 26.0.0 or newer}}
// expected-note@-1 {{add '@available' attribute to enclosing generic struct}}
class B<let N: Int> {} // expected-error {{values in generic types are only available in macOS 26.0.0 or newer}}
// expected-note@-1 {{add '@available' attribute to enclosing generic class}}
enum C<let N: Int> {} // expected-error {{values in generic types are only available in macOS 26.0.0 or newer}}
// expected-note@-1 {{add '@available' attribute to enclosing generic enum}}
func something<let N: Int>(_: A<N>) {} // OK, because A can't reference value generics.