Skip to content

Commit edd4010

Browse files
committed
Gardening: Migrate test suite to GH issues: decl/func
1 parent 0c749b2 commit edd4010

File tree

6 files changed

+32
-22
lines changed

6 files changed

+32
-22
lines changed

test/decl/func/default-values-swift4.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public func publicFunctionWithDefaultValue(
9393
y: Int = internalIntFunction()) {}
9494
// expected-error@-1 {{global function 'internalIntFunction()' is internal and cannot be referenced from a default argument value}}
9595

96-
// https://bugs.swift.org/browse/SR-5559
96+
// https://github.com/apple/swift/issues/48131
9797
public class MyClass {
9898
public func method<T>(_: T.Type = T.self) -> T { }
9999
}

test/decl/func/default-values.swift

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ struct X<T> {
123123
let testXa: X<Int> = .foo(i: 0)
124124
let testXb: X<Int> = .bar
125125

126-
// SR-10062
126+
// https://github.com/apple/swift/issues/52464
127127

128128
var aLiteral = 1
129129
let bLiteral = 2
@@ -175,16 +175,21 @@ let fooThing5 = Foo(a: 0, d: 1, h: nil) // expected-error {{missing arguments fo
175175
let fooThing6 = Foo(a: 0, d: 1, e: 2, h: nil) // expected-error {{missing argument for parameter 'f' in call}}
176176
// expected-note@-29 {{'init(a:b:d:e:f:g:h:)' declared here}}
177177

178-
// SR-11085
179-
func sr_11085(x: Int) {}
180-
func sr_11085(line: String = #line) {} // expected-error {{default argument value of type 'Int' cannot be converted to type 'String'}}
181-
sr_11085()
178+
// https://github.com/apple/swift/issues/53477
179+
do {
180+
func f(x: Int) {}
181+
func f(line: String = #line) {} // expected-error {{default argument value of type 'Int' cannot be converted to type 'String'}}
182+
f()
182183

183-
class SR_11085_C { init(line: String = #line) {} } // expected-error {{default argument value of type 'Int' cannot be converted to type 'String'}}
184-
let _ = SR_11085_C()
184+
class C { init(line: String = #line) {} } // expected-error {{default argument value of type 'Int' cannot be converted to type 'String'}}
185+
let _ = C()
186+
}
187+
188+
// https://github.com/apple/swift/issues/54034
185189

186-
// SR-11623
187-
func badGenericMagicLiteral<T : ExpressibleByIntegerLiteral>(_ x: T = #function) -> T { x } // expected-error {{default argument value of type 'String' cannot be converted to type 'T'}}
190+
// FIXME: Bad diagnostic
191+
// expected-error@+1 {{default argument value of type 'String' cannot be converted to type 'T'}}
192+
func badGenericMagicLiteral<T : ExpressibleByIntegerLiteral>(_ x: T = #function) -> T { x }
188193
let _: Int = badGenericMagicLiteral()
189194

190195
func genericMagicLiteral<T : ExpressibleByIntegerLiteral>(_ x: T = #line) -> T { x } // expected-note {{where 'T' = 'String'}}

test/decl/func/functions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func parentheticalInout2(_ fn: (((inout Int)), Int) -> ()) {
181181
fn(&value, 0)
182182
}
183183

184-
// SR-11724
184+
// https://github.com/apple/swift/issues/54133
185185
// FIXME: None of these diagnostics is particularly good.
186186
func bogusDestructuring() {
187187
struct Bar {}

test/decl/func/rethrows.swift

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ func testDoRethrow() {
536536
DoRethrowGeneric<Int>().method(fn:) { (a, b) in return a }
537537
}
538538

539-
// https://bugs.swift.org/browse/SR-7120 - capture lists
539+
// https://github.com/apple/swift/issues/49668
540540
func rethrowsWithCaptureList<R, T>(
541541
array: [T],
542542
operation: (Int) throws -> R
@@ -553,10 +553,10 @@ public func rdar40472018() {
553553
}
554554

555555

556-
// https://bugs.swift.org/browse/SR-6299
556+
// https://github.com/apple/swift/issues/48849
557557
// Verify that we do not emit an invalid
558558
// "... can throw but the expression is not marked with 'try'"
559-
// error on the use of the operators.
559+
// error on the use of operators.
560560

561561
infix operator <|: infixr0
562562
infix operator |>: infixl1
@@ -613,12 +613,16 @@ func rdar_47550715() {
613613
func bar(_: A<F>? = .none) {} // Ok
614614
}
615615

616-
// SR-14270 - test case for diagnostic note 'because_rethrows_default_argument_throws'
616+
// https://github.com/apple/swift/issues/56630
617+
// Test cases for diagnostic note 'because_rethrows_default_argument_throws'
618+
617619
func nonThrowableDefaultRethrows(_ f: () throws -> () = {}) rethrows {
618620
try f()
619621
}
620-
// NOTE: This should compile and not emit a diagnostic because ideally the compiler could statically
621-
// know the default argument value could never throw. See SR-1524.
622+
623+
// FIXME: This should compile and not emit a diagnostic because ideally the
624+
// compiler could statically know the default argument value could never throw.
625+
// (https://github.com/apple/swift/issues/44143)
622626
nonThrowableDefaultRethrows() // expected-error {{call can throw but is not marked with 'try'}}
623627
// expected-note@-1 {{call is to 'rethrows' function, but a defaulted argument function can throw}}
624628

test/decl/func/throwing_functions_without_try.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ func baz2() -> Int {
5252
return x
5353
}
5454

55-
// SR-11016
55+
// https://github.com/apple/swift/issues/53406
5656

57-
protocol SR_11016_P {
57+
protocol P_53406 {
5858
func bar() throws
5959
}
6060

61-
class SR_11016_C {
62-
var foo: SR_11016_P?
61+
class C_53406 {
62+
var foo: P_53406?
6363

6464
func someMethod() throws {
6565
foo?.bar() // expected-error {{call can throw but is not marked with 'try'}}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
// SR-4205: Don't warn about non-trailing closures followed by parameters with
3+
// https://github.com/apple/swift/issues/46788
4+
// Don't warn about non-trailing closures followed by parameters with
45
// default arguments.
56
func f1(_ f: () -> (), bar: Int = 10) { } // no-warning

0 commit comments

Comments
 (0)