Skip to content

Commit 3bc4c32

Browse files
Merge pull request #60920 from AnthonyLatsis/migrate-test-suite-to-gh-issues-17
Gardening: Migrate test suite to GH issues p. 17
2 parents 6b85bdf + fa3a95e commit 3bc4c32

29 files changed

+126
-90
lines changed

test/NameLookup/InheritedConformance.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
// RUN: cp %s %t/main.swift
33
// RUN: %target-swift-frontend -typecheck -primary-file %t/main.swift -emit-reference-dependencies-path - > %t.swiftdeps
44

5-
// SR-1267, SR-1270
5+
// https://github.com/apple/swift/issues/43875
6+
// https://github.com/apple/swift/issues/43878
7+
68
protocol Protocol {}
79
class ConformingClass: Protocol {}
810
class BaseClass<T: Protocol> {}

test/NameLookup/custom_attrs_ambiguous.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import custom_attrs_A
66
import custom_attrs_B
77

8-
// SR-13470
8+
// https://github.com/apple/swift/issues/55912
99

1010
struct Test {
1111
@Wrapper var x: Int = 17

test/NameLookup/name_lookup.swift

+6-5
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ class ThisDerived1 : ThisBase1 {
288288
self.Type // expected-error {{type 'ThisDerived1' has no member 'Type'}}
289289
}
290290

291-
// FIXME(SR-15250): Partial application diagnostic is applied incorrectly for some test cases.
291+
// FIXME: Partial application diagnostic is applied incorrectly for some
292+
// test cases (https://github.com/apple/swift/issues/57572).
292293
class func staticTestSuper1() {
293294
super.baseInstanceVar = 42 // expected-error {{member 'baseInstanceVar' cannot be used on type 'ThisBase1'}}
294295
super.baseProp = 42 // expected-error {{member 'baseProp' cannot be used on type 'ThisBase1'}}
@@ -585,8 +586,8 @@ func foo1() {
585586
_ = MyGenericEnum<Int>.OneTwo // expected-error {{enum type 'MyGenericEnum<Int>' has no case 'OneTwo'; did you mean 'oneTwo'?}}{{26-32=oneTwo}}
586587
}
587588

588-
// SR-4082
589-
func foo2() {
589+
// https://github.com/apple/swift/issues/46665
590+
do {
590591
let x = 5
591592
if x < 0, let x = Optional(1) { } // expected-warning {{immutable value 'x' was never used; consider replacing with '_' or removing it}}
592593
}
@@ -649,8 +650,8 @@ struct PatternBindingWithTwoVars3 { var x = y, y = x }
649650
// expected-note@-11 {{through reference here}}
650651
// expected-note@-12 {{through reference here}}
651652

652-
// https://bugs.swift.org/browse/SR-9015
653-
func sr9015() {
653+
// https://github.com/apple/swift/issues/51518
654+
do {
654655
let closure1 = { closure2() } // expected-error {{circular reference}} expected-note {{through reference here}} expected-note {{through reference here}}
655656
let closure2 = { closure1() } // expected-note {{through reference here}} expected-note {{through reference here}} expected-note {{through reference here}}
656657
}

test/Parse/ConditionalCompilation/decl_in_true_inactive.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// RUN: %target-typecheck-verify-swift -D FOO -D BAR
22

3-
// SR-3996 Incorrect type checking when using defines
3+
// https://github.com/apple/swift/issues/46581
4+
// Incorrect type checking when using defines
5+
//
46
// Decls in true-but-inactive blocks used to be leaked.
7+
58
func f1() -> Int {
69
#if FOO
710
let val = 1

test/Parse/ConditionalCompilation/pound-if-top-level-4.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
// https://bugs.swift.org/browse/SR-4426
4-
// '#if' in top-level code that contains only decls should not disturb forward reference.
3+
// https://github.com/apple/swift/issues/47003
4+
// '#if' in top-level code that contains only declarations should not disturb
5+
// forward reference.
56

67
typealias A = B
78

test/Parse/diagnose_availability.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
// SR-4231: Misleading/wrong error message for malformed @available
3+
// https://github.com/apple/swift/issues/46814
4+
// Misleading/wrong error message for malformed '@available'
45

56
@available(OSX 10.6, *) // no error
67
func availableSince10_6() {}
@@ -28,7 +29,8 @@ func availableOnMultiplePlatforms() {}
2829
func twoShorthandsFollowedByDeprecated() {}
2930

3031

31-
// SR-8598: Missing/wrong warning message for '*' or 'swift' platform.
32+
// https://github.com/apple/swift/issues/51114
33+
// Missing/wrong warning message for '*' or 'swift' platform.
3234

3335
@available(*, deprecated: 4.2)
3436
// expected-warning@-1 {{unexpected version number in 'available' attribute for non-specific platform '*'}} {{25-30=}}

test/Parse/diagnose_initializer_as_typed_pattern.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
// https://bugs.swift.org/browse/SR-1461
3+
// https://github.com/apple/swift/issues/44070
44

55
class X {}
66
func foo() {}

test/Parse/diagnostic_missing_func_keyword.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
// https://bugs.swift.org/browse/SR-10477
3+
// https://github.com/apple/swift/issues/52877
44

55
protocol Brew { // expected-note {{in declaration of 'Brew'}}
66
tripel() -> Int // expected-error {{expected 'func' keyword in instance method declaration}} {{3-3=func }}

test/Parse/dollar_identifier.swift

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -swift-version 4
22

3-
// SR-1661: Dollar was accidentally allowed as an identifier in Swift 3.
3+
// https://github.com/apple/swift/issues/44270
4+
// Dollar was accidentally allowed as an identifier in Swift 3.
45
// SE-0144: Reject this behavior in the future.
56

67
func dollarVar() {
@@ -105,7 +106,8 @@ infix operator **: $Precedence
105106
#$UnknownDirective() // expected-error {{use of unknown directive '#$UnknownDirective'}}
106107

107108

108-
// SR-13232
109+
// https://github.com/apple/swift/issues/55672
110+
109111
@propertyWrapper
110112
struct Wrapper {
111113
var wrappedValue: Int
@@ -118,5 +120,6 @@ struct S {
118120

119121
let _ = S().$café // Okay
120122

121-
infix operator $ // expected-error{{'$' is considered an identifier and must not appear within an operator name}} // SR-13092
122-
infix operator `$` // expected-error{{'$' is considered an identifier and must not appear within an operator name}} // SR-13092
123+
// https://github.com/apple/swift/issues/55538
124+
infix operator $ // expected-error{{'$' is considered an identifier and must not appear within an operator name}}
125+
infix operator `$` // expected-error{{'$' is considered an identifier and must not appear within an operator name}}

test/Parse/enum.swift

+9-8
Original file line numberDiff line numberDiff line change
@@ -553,42 +553,43 @@ enum SE0155 {
553553
// expected-note@-2 {{did you mean to explicitly add a 'Void' associated value?}} {{18-18=Void}}
554554
}
555555

556-
// SR-11261
557-
enum SR11261 {
556+
// https://github.com/apple/swift/issues/53662
557+
558+
enum E_53662 {
558559
case identifier
559560
case operator // expected-error {{keyword 'operator' cannot be used as an identifier here}} expected-note {{if this name is unavoidable, use backticks to escape it}} {{8-16=`operator`}}
560561
case identifier2
561562
}
562563

563-
enum SR11261_var {
564+
enum E_53662_var {
564565
case identifier
565566
case var // expected-error {{keyword 'var' cannot be used as an identifier here}} expected-note {{if this name is unavoidable, use backticks to escape it}} {{8-11=`var`}}
566567
case identifier2
567568
}
568569

569-
enum SR11261_underscore {
570+
enum E_53662_underscore {
570571
case identifier
571572
case _ // expected-error {{keyword '_' cannot be used as an identifier here}} expected-note {{if this name is unavoidable, use backticks to escape it}} {{8-9=`_`}}
572573
case identifier2
573574
}
574575

575-
enum SR11261_Comma {
576+
enum E_53662_Comma {
576577
case a, b, c, func, d // expected-error {{keyword 'func' cannot be used as an identifier here}} expected-note {{if this name is unavoidable, use backticks to escape it}} {{17-21=`func`}}
577578
}
578579

579-
enum SR11261_Newline {
580+
enum E_53662_Newline {
580581
case identifier1
581582
case identifier2
582583
case
583584
case identifier // expected-error {{keyword 'case' cannot be used as an identifier here}} expected-note {{if this name is unavoidable, use backticks to escape it}} {{3-7=`case`}}
584585
}
585586

586-
enum SR11261_Newline2 {
587+
enum E_53662_Newline2 {
587588
case
588589
func foo() {} // expected-error {{keyword 'func' cannot be used as an identifier here}} expected-note {{if this name is unavoidable, use backticks to escape it}} {{3-7=`func`}}
589590
}
590591

591-
enum SR11261_PatternMatching {
592+
enum E_53662_PatternMatching {
592593
case let .foo(x, y): // expected-error {{'case' label can only appear inside a 'switch' statement}}
593594
}
594595

test/Parse/enum_element_pattern_swift4.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %target-typecheck-verify-swift -swift-version 4
22

3-
// https://bugs.swift.org/browse/SR-3452
3+
// https://github.com/apple/swift/issues/46040
44
// See test/Compatibility/enum_element_pattern.swift for Swift3 behavior.
5-
// As for FIXME cases: see https://bugs.swift.org/browse/SR-3466
5+
// As for FIXME cases: see https://github.com/apple/swift/issues/46054
66

77
enum E {
88
case A, B, C, D

test/Parse/errors.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ func fixitThrow2() throws {
155155

156156
let fn: () -> throws Void // expected-error{{'throws' may only occur before '->'}} {{12-12=throws }} {{15-22=}}
157157

158-
// SR-11574
158+
// https://github.com/apple/swift/issues/53979
159+
159160
func fixitTry0<T>(a: T) try where T:ExpressibleByStringLiteral {} // expected-error{{expected throwing specifier; did you mean 'throws'?}} {{25-28=throws}}
160161
func fixitTry1<T>(a: T) try {} // expected-error{{expected throwing specifier; did you mean 'throws'?}} {{25-28=throws}}
161162
func fixitTry2() try {} // expected-error{{expected throwing specifier; did you mean 'throws'?}} {{18-21=throws}}

test/Parse/init_deinit.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ func barFunc() {
118118
} ()
119119
}
120120

121-
// SR-852
121+
// https://github.com/apple/swift/issues/43464
122+
122123
class Aaron {
123124
init(x: Int) {}
124125
convenience init() { init(x: 1) } // expected-error {{missing 'self.' at initializer invocation}} {{24-24=self.}}

test/Parse/invalid.swift

+36-27
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,34 @@ protocol Animal<Food> { // expected-error {{an associated type named 'Food' mus
7575
}
7676

7777

78+
// https://github.com/apple/swift/issues/43190
79+
// Crash with invalid parameter declaration
80+
do {
81+
class Starfish {}
82+
struct Salmon {}
83+
func f(s Starfish, // expected-error {{expected ':' following argument label and parameter name}}
84+
_ ss: Salmon) -> [Int] {}
85+
func g() { f(Starfish(), Salmon()) }
86+
}
87+
88+
// https://github.com/apple/swift/issues/43313
89+
do {
90+
func f(_ a: Int, b: Int) {}
91+
f(1, b: 2,) // expected-error {{unexpected ',' separator}}
92+
}
7893

79-
// SR-573 - Crash with invalid parameter declaration
80-
class Starfish {}
81-
struct Salmon {}
82-
func f573(s Starfish, // expected-error {{expected ':' following argument label and parameter name}}
83-
_ ss: Salmon) -> [Int] {}
84-
func g573() { f573(Starfish(), Salmon()) }
85-
86-
func SR698(_ a: Int, b: Int) {}
87-
SR698(1, b: 2,) // expected-error {{unexpected ',' separator}}
88-
89-
// SR-979 - Two inout crash compiler
90-
func SR979a(a : inout inout Int) {} // expected-error {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{17-23=}}
91-
func SR979b(inout inout b: Int) {} // expected-error {{inout' before a parameter name is not allowed, place it before the parameter type instead}} {{13-18=}} {{28-28=inout }}
92-
// expected-error@-1 {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{19-25=}}
93-
func SR979d(let let a: Int) {} // expected-warning {{'let' in this position is interpreted as an argument label}} {{13-16=`let`}}
94-
// expected-error @-1 {{expected ',' separator}} {{20-20=,}}
94+
// https://github.com/apple/swift/issues/43591
95+
// Two inout crash compiler
96+
97+
func f1_43591(a : inout inout Int) {} // expected-error {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{19-25=}}
98+
func f2_43591(inout inout b: Int) {} // expected-error {{inout' before a parameter name is not allowed, place it before the parameter type instead}} {{15-20=}} {{30-30=inout }}
99+
// expected-error@-1 {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{21-27=}}
100+
func f3_43591(let let a: Int) {} // expected-warning {{'let' in this position is interpreted as an argument label}} {{15-18=`let`}}
101+
// expected-error @-1 {{expected ',' separator}} {{22-22=,}}
95102
// expected-error @-2 {{expected ':' following argument label and parameter name}}
96-
// expected-warning @-3 {{extraneous duplicate parameter name; 'let' already has an argument label}} {{13-17=}}
97-
func SR979e(inout x: inout String) {} // expected-error {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{13-18=}}
98-
func SR979g(inout i: inout Int) {} // expected-error {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{13-18=}}
103+
// expected-warning @-3 {{extraneous duplicate parameter name; 'let' already has an argument label}} {{15-19=}}
104+
func f4_43591(inout x: inout String) {} // expected-error {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{15-20=}}
105+
func f5_43591(inout i: inout Int) {} // expected-error {{parameter must not have multiple '__owned', 'inout', or '__shared' specifiers}} {{15-20=}}
99106

100107
func repeat() {}
101108
// expected-error @-1 {{keyword 'repeat' cannot be used as an identifier here}}
@@ -136,15 +143,17 @@ let x: () = ()
136143
!(x) // expected-error {{cannot convert value of type '()' to expected argument type 'Bool'}}
137144
!x // expected-error {{cannot convert value of type '()' to expected argument type 'Bool'}}
138145

139-
func sr8202_foo(@NSApplicationMain x: Int) {} // expected-error {{@NSApplicationMain may only be used on 'class' declarations}}
140-
func sr8202_bar(@available(iOS, deprecated: 0) x: Int) {} // expected-error {{'@available' attribute cannot be applied to this declaration}}
141-
func sr8202_baz(@discardableResult x: Int) {} // expected-error {{'@discardableResult' attribute cannot be applied to this declaration}}
142-
func sr8202_qux(@objcMembers x: String) {} // expected-error {{@objcMembers may only be used on 'class' declarations}}
143-
func sr8202_quux(@weak x: String) {} // expected-error {{'weak' is a declaration modifier, not an attribute}} expected-error {{'weak' may only be used on 'var' declarations}}
146+
// https://github.com/apple/swift/issues/50734
147+
148+
func f1_50734(@NSApplicationMain x: Int) {} // expected-error {{@NSApplicationMain may only be used on 'class' declarations}}
149+
func f2_50734(@available(iOS, deprecated: 0) x: Int) {} // expected-error {{'@available' attribute cannot be applied to this declaration}}
150+
func f3_50734(@discardableResult x: Int) {} // expected-error {{'@discardableResult' attribute cannot be applied to this declaration}}
151+
func f4_50734(@objcMembers x: String) {} // expected-error {{@objcMembers may only be used on 'class' declarations}}
152+
func f5_50734(@weak x: String) {} // expected-error {{'weak' is a declaration modifier, not an attribute}} expected-error {{'weak' may only be used on 'var' declarations}}
144153

145-
class sr8202_cls<@NSApplicationMain T: AnyObject> {} // expected-error {{@NSApplicationMain may only be used on 'class' declarations}}
146-
func sr8202_func<@discardableResult T>(x: T) {} // expected-error {{'@discardableResult' attribute cannot be applied to this declaration}}
147-
enum sr8202_enum<@indirect T> {} // expected-error {{'indirect' is a declaration modifier, not an attribute}} expected-error {{'indirect' modifier cannot be applied to this declaration}}
154+
class C_50734<@NSApplicationMain T: AnyObject> {} // expected-error {{@NSApplicationMain may only be used on 'class' declarations}}
155+
func f6_50734<@discardableResult T>(x: T) {} // expected-error {{'@discardableResult' attribute cannot be applied to this declaration}}
156+
enum E_50734<@indirect T> {} // expected-error {{'indirect' is a declaration modifier, not an attribute}} expected-error {{'indirect' modifier cannot be applied to this declaration}}
148157
protocol P {
149158
@available(swift, introduced: 4.2) associatedtype Assoc // expected-error {{'@available' attribute cannot be applied to this declaration}}
150159
}

test/Parse/line-directive.swift

+9-7
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,26 @@ LABEL:
4949
#line 200 "labeled.swift"
5050
#sourceLocation()
5151

52+
// https://github.com/apple/swift/issues/47817
5253
class C {
53-
#sourceLocation(file: "sr5242.swift", line: 100)
54+
#sourceLocation(file: "issue-47817.swift", line: 100)
5455
func foo() {}
5556
let bar = 12
56-
#sourceLocation(file: "sr5242.swift", line: 200)
57+
#sourceLocation(file: "issue-47817", line: 200)
5758
}
5859
enum E {
59-
#sourceLocation(file: "sr5242.swift", line: 300)
60+
#sourceLocation(file: "issue-47817", line: 300)
6061
case A, B
6162
case C, D
6263
#sourceLocation()
6364
}
6465

65-
#sourceLocation(file: "sr8772.swift", line: 400)
66+
// https://github.com/apple/swift/issues/51280
67+
#sourceLocation(file: "issue-51280.swift", line: 400)
6668
2., 3
67-
// CHECK: sr8772.swift:400:2: error: expected member name following '.'
68-
// CHECK: sr8772.swift:400:3: error: consecutive statements on a line must be separated by ';'
69-
// CHECK: sr8772.swift:400:3: error: expected expression
69+
// CHECK: issue-51280.swift:400:2: error: expected member name following '.'
70+
// CHECK: issue-51280.swift:400:3: error: consecutive statements on a line must be separated by ';'
71+
// CHECK: issue-51280.swift:400:3: error: expected expression
7072

7173
// https://github.com/apple/swift/issues/55049
7274
class I55049 {

test/Parse/pattern_without_variables.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func testVarLetPattern(a : SimpleEnum) {
3838
if case let _ = "str" {} // expected-warning {{'let' pattern has no effect; sub-pattern didn't bind any variables}} {{11-15=}}
3939
}
4040

41-
class SR10903 {
41+
// https://github.com/apple/swift/issues/53293
42+
class C_53293 {
4243
static var _: Int { 0 } //expected-error {{getter/setter can only be defined for a single variable}}
4344
}

test/Parse/raw_string.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ _ = ##"""
7676
/// then you may need to tweak how to test for single-line string literals that
7777
/// resemble a multiline delimiter in `advanceIfMultilineDelimiter` so that it
7878
/// passes again.
79-
/// See https://bugs.swift.org/browse/SR-8678
79+
/// See https://github.com/apple/swift/issues/51192.
8080
_ = #"​"​"#
8181
// CHECK: "​\"​"
8282

0 commit comments

Comments
 (0)