Skip to content

Gardening: Migrate test suite to GH issues p. 1 #60506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/api-digester/stability-concurrency-abi.test
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)

// SR-13362
// https://github.com/apple/swift/issues/55803
// We currently only have a baseline for Intel CPUs on macOS.
// REQUIRES: OS=macosx
// REQUIRES: CPU=x86_64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)

// SR-13362
// https://github.com/apple/swift/issues/55803
// We currently only have a baseline for Intel CPUs on macOS.
// REQUIRES: OS=macosx
// REQUIRES: CPU=x86_64
Expand Down
2 changes: 1 addition & 1 deletion test/api-digester/stability-stdlib-abi-with-asserts.test
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)

// SR-13362
// https://github.com/apple/swift/issues/55803
// We currently only have a baseline for Intel CPUs on macOS.
// REQUIRES: OS=macosx
// REQUIRES: CPU=x86_64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)

// SR-13362
// https://github.com/apple/swift/issues/55803
// We currently only have a baseline for Intel CPUs on macOS.
// REQUIRES: OS=macosx && CPU=x86_64

Expand Down
2 changes: 1 addition & 1 deletion test/api-digester/stability-stdlib-source.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// REQUIRES: OS=macosx

// SR-13362
// https://github.com/apple/swift/issues/55803
// This currently fails on non-Intel architectures due to no baseline being
// available and it is not possible to filter across architectures in the
// output.
Expand Down
3 changes: 2 additions & 1 deletion test/attr/accessibility_proto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ public struct NonPublicMemberwiseInitStruct: PublicInitProto {
public var value: Int
}

// SR-15273
// https://github.com/apple/swift/issues/57595

public protocol PublicEmptyInit {
init()
}
Expand Down
30 changes: 18 additions & 12 deletions test/attr/attr_autoclosure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,17 @@ func rdar_20591571() {
}
}

// rdar://problem/30906031 - [SR-4188]: withoutActuallyEscaping doesn't accept an @autoclosure argument
/// rdar://problem/30906031 [https://github.com/apple/swift/issues/46771]
/// `withoutActuallyEscaping` doesn't accept an @autoclosure argument

func rdar_30906031(in arr: [Int], fn: @autoclosure () -> Int) -> Bool {
return withoutActuallyEscaping(fn) { escapableF in // Ok
arr.lazy.filter { $0 >= escapableF() }.isEmpty
}
}

// SR-2688
// https://github.com/apple/swift/issues/45293

class Foo {
typealias FooClosure = () -> String
func fooFunction(closure: @autoclosure FooClosure) {} // ok
Expand Down Expand Up @@ -282,19 +285,22 @@ func test_autoclosure_with_generic_argument_mismatch() {
foo(S<String>()) // expected-error {{cannot convert value of type 'S<String>' to expected argument type 'S<Int>'}}
}

// SR-11934
func sr_11934(_ x: @autoclosure String...) {} // expected-error {{'@autoclosure' must not be used on variadic parameters}}
// https://github.com/apple/swift/issues/54353

func f_54353(_ x: @autoclosure String...) {} // expected-error {{'@autoclosure' must not be used on variadic parameters}}

// https://github.com/apple/swift/issues/54357

let _: Array<@autoclosure String> = [] // expected-error {{'@autoclosure' may only be used on parameters}}
func f1_54357() -> @autoclosure String {} // expected-error {{'@autoclosure' may only be used on parameters}}
func f2_54357(_ x: [@autoclosure String]) {} // expected-error {{'@autoclosure' may only be used on parameters}}

// SR-11938
let sr_11938_1: Array<@autoclosure String> = [] // expected-error {{'@autoclosure' may only be used on parameters}}
func sr_11938_2() -> @autoclosure String { "" } // expected-error {{'@autoclosure' may only be used on parameters}}
func sr_11938_3(_ x: [@autoclosure String]) {} // expected-error {{'@autoclosure' may only be used on parameters}}
protocol P_54357 {}
struct S_54357 : @autoclosure P_54357 {} // expected-error {{'@autoclosure' may only be used on parameters}}

protocol SR_11938_P {}
struct SR_11938_S : @autoclosure SR_11938_P {} // expected-error {{'@autoclosure' may only be used on parameters}}
// https://github.com/apple/swift/issues/51669

// SR-9178
func bar<T>(_ x: @autoclosure T) {} // expected-error 1{{@autoclosure attribute only applies to function types}}
func f_51669<T>(_ x: @autoclosure T) {} // expected-error 1{{@autoclosure attribute only applies to function types}}

func test_autoclosure_type_in_parens() {
let _: (@autoclosure (() -> Void)) -> Void = { _ in } // Ok
Expand Down
6 changes: 4 additions & 2 deletions test/attr/attr_availability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1056,15 +1056,17 @@ class SubInheritedDeprecatedInit: BaseDeprecatedInit { }

_ = SubInheritedDeprecatedInit(bad: 0) // expected-warning {{'init(bad:)' is deprecated}}

// https://github.com/apple/swift/issues/51149
// Should produce no warnings.
enum SR8634_Enum: Int {

enum Enum_51149: Int {
case a
@available(*, deprecated, message: "I must not be raised in synthesized code")
case b
case c
}

struct SR8634_Struct: Equatable {
struct Struct_51149: Equatable {
@available(*, deprecated, message: "I must not be raised in synthesized code", renamed: "x")
let a: Int
}
Expand Down
36 changes: 19 additions & 17 deletions test/attr/attr_convention.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,30 @@ let f4c: @convention(c, cType: "int (*)(int)") (Int32) -> Int32 = { $0 }

let f5: @convention(INTERCAL) (Int) -> Int = { $0 } // expected-error{{convention 'INTERCAL' not supported}}

// SR-11027
// https://github.com/apple/swift/issues/53417

func sr11027(_ f: @convention(block) @autoclosure () -> Int) -> Void {} // expected-error {{'@convention(block)' attribute is not allowed on '@autoclosure' types}}
sr11027(1)
do {
func block(_ f: @convention(block) @autoclosure () -> Int) -> Void {} // expected-error {{'@convention(block)' attribute is not allowed on '@autoclosure' types}}
block(1)

func sr11027_c(_ f: @convention(c) @autoclosure () -> Int) -> Void {} // expected-error{{'@convention(c)' attribute is not allowed on '@autoclosure' types}}
sr11027_c(1)
func c(_ f: @convention(c) @autoclosure () -> Int) -> Void {} // expected-error{{'@convention(c)' attribute is not allowed on '@autoclosure' types}}
c(1)

func sr11027_swift(_ f: @convention(swift) @autoclosure () -> Int) -> Void {} // OK
sr11027_swift(1)
func swift(_ f: @convention(swift) @autoclosure () -> Int) -> Void {} // OK
swift(1)

func sr11027_thin(_ f: @convention(thin) @autoclosure () -> Int) -> Void {} // OK
sr11027_thin(1)
func thin(_ f: @convention(thin) @autoclosure () -> Int) -> Void {} // OK
thin(1)

func sr11027_2(_ f: @autoclosure @convention(block) () -> Int) -> Void {} // expected-error {{'@convention(block)' attribute is not allowed on '@autoclosure' types}}
sr11027_2(1)
func block2(_ f: @autoclosure @convention(block) () -> Int) -> Void {} // expected-error {{'@convention(block)' attribute is not allowed on '@autoclosure' types}}
block2(1)

func sr11027_c_2(_ f: @autoclosure @convention(c) () -> Int) -> Void {} // expected-error {{'@convention(c)' attribute is not allowed on '@autoclosure' types}}
sr11027_c_2(1)
func c2(_ f: @autoclosure @convention(c) () -> Int) -> Void {} // expected-error {{'@convention(c)' attribute is not allowed on '@autoclosure' types}}
c2(1)

func sr11027_swift_2(_ f: @autoclosure @convention(swift) () -> Int) -> Void {} // OK
sr11027_swift_2(1)
func swift2(_ f: @autoclosure @convention(swift) () -> Int) -> Void {} // OK
swift2(1)

func sr11027_thin_2(_ f: @autoclosure @convention(thin) () -> Int) -> Void {} // OK
sr11027_thin_2(1)
func thin2(_ f: @autoclosure @convention(thin) () -> Int) -> Void {} // OK
thin2(1)
}
38 changes: 22 additions & 16 deletions test/attr/attr_discardableResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,20 +180,26 @@ func testOptionalChaining(c1: C1?, s1: S1?) {
s1!.f2Optional() // expected-warning {{result of call to 'f2Optional()' is unused}}
}

@discardableResult func SR2948 (_ closure: @escaping ()->()) -> (()->()) {
// https://github.com/apple/swift/issues/45542

@discardableResult func f_45542(_ closure: @escaping ()->()) -> (()->()) {
closure()
return closure
}
SR2948({}) // okay

class SR7562_A {
@discardableResult required init(input: Int) { }
do {
f_45542({}) // okay
}

class SR7562_B : SR7562_A {}
// https://github.com/apple/swift/issues/50104

SR7562_A(input: 10) // okay
SR7562_B(input: 10) // okay
class C1_50104 {
@discardableResult required init(input: Int) { }
}
class C2_50104 : C1_50104 {}
do {
C1_50104(input: 10) // okay
C2_50104(input: 10) // okay
}

protocol FooProtocol {}

Expand Down Expand Up @@ -223,9 +229,9 @@ class Discard {
}
}

// SR-12271
// https://github.com/apple/swift/issues/54699

struct SR_12271_S {
struct S_54699 {
@discardableResult
func bar1() -> () -> Void {
return {}
Expand All @@ -236,9 +242,9 @@ struct SR_12271_S {
return {}
}
}

SR_12271_S().bar1() // Okay
SR_12271_S.bar2() // Okay

SR_12271_S().bar1 // expected-error {{function is unused}}
SR_12271_S.bar2 // expected-error {{function is unused}}
do {
S_54699().bar1() // Okay
S_54699.bar2() // Okay
S_54699().bar1 // expected-error {{function is unused}}
S_54699.bar2 // expected-error {{function is unused}}
}
3 changes: 2 additions & 1 deletion test/attr/attr_dynamic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class InheritsDynamic: Foo {
override func notDynamic() {}
}

// SR-5317
// https://github.com/apple/swift/issues/47892

@objcMembers
class ObjCMemberCheck {
dynamic var s = NotObjCAble(c: Foo())
Expand Down
61 changes: 32 additions & 29 deletions test/attr/attr_dynamic_callable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -442,21 +442,21 @@ func testArchetypeType5<T, C : CallableGeneric5<T>>(a: C) -> Double {
return a(1, 2, 3) + a(x1: 1, 2, x3: 3)
}

// SR-9239 Default argument in initializer
// https://github.com/apple/swift/issues/51727
// Default argument in initializer

@dynamicCallable
struct A {
struct S_51727 {
init(_ x: Int = 0) {}
func dynamicallyCall(withArguments args: [Int]) {}
}

func test9239() {
A()() // ok
do {
S_51727()() // ok
}

// SR-10313
// https://github.com/apple/swift/issues/52713
//
// Modified version of the code snippet in the SR to not crash.
// Modified version of the code snippet in the issue report to not crash.

struct MissingKeyError: Error {}

Expand All @@ -471,56 +471,59 @@ class DictionaryBox {
return value
}
}

func test10313() {
do {
let box = DictionaryBox()
box.dictionary["bool"] = false
let _: Bool = try! box("bool") // ok
}

// SR-10753
// https://github.com/apple/swift/issues/53143

@dynamicCallable
struct B {
struct S_53143 {
public func dynamicallyCall(withArguments arguments: [String]) {}
}
do {
S_53143()("hello") // ok
S_53143()("\(1)") // ok
}

B()("hello") // ok
B()("\(1)") // ok
// https://github.com/apple/swift/issues/54456

// SR-12019
@dynamicCallable
struct SR12019_S {
struct S_54456 {
func dynamicallyCall<T: StringProtocol>(withArguments: [T]) { // expected-note {{where 'T' = 'Int'}}
print("hi")
}
}

@dynamicCallable
protocol SR12019 {
protocol P_54456 {
func dynamicallyCall<T: StringProtocol>(withArguments: [T]) // expected-note 2{{where 'T' = 'Int'}}
}

class SR12019Class: SR12019 {
class C_54456: P_54456 {
func dynamicallyCall<T: StringProtocol>(withArguments: [T]) {} // expected-note {{where 'T' = 'Int'}}
}

class SR12019SubClass: SR12019Class {}
class SubC_54456: C_54456 {}

let sr12019s = SR12019_S()
sr12019s(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
do {
let s = S_54456()
s(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}

// Protocol composition
let sr12019: SR12019&AnyObject = SR12019Class()
sr12019(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
// Protocol composition
let pc: P_54456 & AnyObject = C_54456()
pc(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}

// Protocol
let sr12019c: SR12019 = SR12019Class()
sr12019c(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
// Protocol
let p: P_54456 = C_54456()
p(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}

// Subclass
let sr12019sub = SR12019SubClass()
sr12019sub(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
// Subclass
let sub = SubC_54456()
sub(1) // expected-error {{instance method 'dynamicallyCall(withArguments:)' requires that 'Int' conform to 'StringProtocol'}}
}

protocol P {}
extension P {
Expand Down
Loading