Files
swift-mirror/test/SILOptimizer/access_wmo_diagnose.swift
Daniel Rodríguez Troitiño 5abb1ea6ac [test] Remove some REQUIRES: for features not longer used in those files
While doing #76740 I iteratively was adding new `REQUIRES:` as new
usages of the features were found, but I did not realize that at the
same time other people might be removing some of those usages. The tests
in this commit had some `REQUIRES:` line for a previous
`-enable-experimental/upcoming-feature`, but they not longer use those
features, so the `REQUIRES:` were effectively disabling the tests (at
least in the case of `KeyPathWithStaticMembers`. In other cases they
might still had executed).
2024-11-04 20:53:07 -08:00

15 lines
674 B
Swift

// RUN: %target-swift-frontend -parse-as-library -emit-sil -enforce-exclusivity=checked -primary-file %s -o /dev/null -verify
// AccessEnforcementWMO assumes that the only way to address a global or static
// property is via a formal begin_access. If we ever allow keypaths for static
// properties, which I think is conceivable, then this test will fail to produce
// a diagnostic error and AccessEnforcementWMO must be fixed to handle "meta"
// keypaths.
public class C {
public static var globalProp: Int = 0
}
public func testGlobalProp() {
let a: AnyKeyPath = \C.globalProp // expected-error{{static member 'globalProp' cannot be used on instance of type 'C'}}
}