mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Find all the usages of `--enable-experimental-feature` or `--enable-upcoming-feature` in the tests and replace some of the `REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which should correctly apply to depending on the asserts/noasserts mode of the toolchain for each feature. Remove some comments that talked about enabling asserts since they don't apply anymore (but I might had miss some). All this was done with an automated script, so some formatting weirdness might happen, but I hope I fixed most of those. There might be some tests that were `REQUIRES: asserts` that might run in `noasserts` toolchains now. This will normally be because their feature went from experimental to upcoming/base and the tests were not updated.
30 lines
799 B
Swift
30 lines
799 B
Swift
// RUN: %target-swift-emit-ir -verify %s -parse-stdlib -enable-experimental-feature Embedded -target arm64e-apple-none -wmo
|
|
|
|
// REQUIRES: swift_in_compiler
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
public class MyClass {
|
|
func foo<T>(t: T) { } // expected-error {{classes cannot have non-final generic functions in embedded Swift}}
|
|
func bar() { }
|
|
}
|
|
|
|
final class C2<Element> {
|
|
// TODO: this shouldn't be a problem because the class is final
|
|
init<T>(x: T) { } // expected-error {{classes cannot have non-final generic functions in embedded Swift}}
|
|
}
|
|
|
|
struct S {}
|
|
|
|
func testit2() -> C2<S> {
|
|
return C2(x: S())
|
|
}
|
|
|
|
open class C3<X> {
|
|
public func foo<T>(t: T) {} // expected-error {{classes cannot have non-final generic functions in embedded Swift}}
|
|
}
|
|
|
|
func testit3() -> C3<S> {
|
|
return C3<S>()
|
|
}
|
|
|