Skip to content

Gardening: Migrate test suite to GH issues p. 9 #60718

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
3 changes: 2 additions & 1 deletion test/CrossImport/horrible.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import UnitaryGoose
// expected-error@-1 {{cannot list cross-import overlays for 'UnitaryGoose':}}

// FIXME: It might be better to diagnose these errors on HorribleGoose's import
// decl, since they actually belong to HorribleGoose. (SR-12223)
// decl, since they actually belong to HorribleGoose.
// (https://github.com/apple/swift/issues/54649)

import FlockOfGoose
// expected-error@-1 {{cannot load cross-import overlay for 'HorribleGoose' and 'FlockOfGoose':}}
Expand Down
5 changes: 3 additions & 2 deletions test/CrossImport/remark-option.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// RUN: %target-typecheck-verify-swift -enable-cross-import-overlays -Rcross-import -I %t/include -I %t/lib/swift -F %t/Frameworks

import DeclaringLibrary
// FIXME: Similarly to horrible.swift, ideally we would emit this remark on DeclaringLibrary
// decl, since the cross-import overlay actually belongs to the DeclaringLibrary. (SR-12223)
// FIXME: Similarly to horrible.swift, ideally we would emit this remark on
// DeclaringLibrary decl, since the cross-import overlay actually belongs to
// the DeclaringLibrary. (https://github.com/apple/swift/issues/54649)
import BystandingLibrary // expected-remark {{import of 'DeclaringLibrary' and 'BystandingLibrary' triggered a cross-import of '_OverlayLibrary'}}
4 changes: 2 additions & 2 deletions test/DebugInfo/debug_variable.sil
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import Swift

sil_scope 2 { loc "simple.swift":1:2 parent @test_debug_value : $@convention(thin) (Int) -> () }

// SR-14868: Incorrect source location on `llvm.dbg.declare` when the input
// is SIL file.
// https://github.com/apple/swift/issues/57215
// Incorrect source location on 'llvm.dbg.declare' when the input is a SIL file

// CHECK: @test_debug_value
// CHECK-SAME: !dbg ![[FUNC_DI:[0-9]+]]
Expand Down
4 changes: 3 additions & 1 deletion test/DebugInfo/optimizer_pipeline.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import Swift

// Test that DCE correctly preserves debug locations.
// SR-15300: Compiler crash when using Builtin.unreachable in initializers

// https://github.com/apple/swift/issues/57622
// Compiler crash when using 'Builtin.unreachable' in initializers
//
// CHECK: sil_scope [[S1:[0-9]+]] { {{.*}} parent @$s18optimizer_pipeline1AVyACs13KeyValuePairsVyypypGcfC
// CHECK: sil_scope [[S2:[0-9]+]] { {{.*}} parent [[S1]] }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %target-swift-frontend -emit-ir -g -primary-file %s

// https://bugs.swift.org/browse/SR-14016
// https://github.com/apple/swift/issues/56409

public struct PowerCollection<C : Collection> : Collection {
public typealias Index = [C.Index]
Expand Down
10 changes: 5 additions & 5 deletions test/decl/circularity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ class D4 : C4, P1 { // expected-note 3 {{through reference here}}
}
}

// SR-12236
// https://github.com/apple/swift/issues/54662
// N.B. This used to compile in 5.1.
protocol SR12236 { }
class SR12236_A { // expected-note {{through reference here}}
typealias Nest = SR12236 // expected-error {{circular reference}} expected-note {{through reference here}}
protocol P_54662 { }
class C_54662 { // expected-note {{through reference here}}
typealias Nest = P_54662 // expected-error {{circular reference}} expected-note {{through reference here}}
}
extension SR12236_A: SR12236_A.Nest { }
extension C_54662: C_54662.Nest { }
10 changes: 6 additions & 4 deletions test/decl/enum/enumtest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ func testSimpleEnum() {
let _ : SimpleEnum=.X // expected-error {{'=' must have consistent whitespace on both sides}}
}

enum SR510: String {
// https://github.com/apple/swift/issues/43127
enum E_43127: String {
case Thing = "thing"
case Bob = {"test"} // expected-error {{raw value for enum case must be a literal}}
}
Expand Down Expand Up @@ -337,7 +338,8 @@ enum HasVariadic {
case variadic(x: Int...) // expected-error {{variadic enum cases are not supported}}
}

// SR-2176
// https://github.com/apple/swift/issues/44784

enum Foo {
case bar
case none
Expand Down Expand Up @@ -446,7 +448,7 @@ protocol P {}
enum E : C & P {}
// expected-error@-1 {{inheritance from class-constrained protocol composition type 'C & P'}}

// SR-11522
// https://github.com/apple/swift/issues/53923

enum EnumWithStaticNone1 {
case a
Expand Down Expand Up @@ -573,7 +575,7 @@ let _: EnumWithTypealiasNone? = .none // Okay
let _: EnumWithBothStructAndComputedNone? = .none // Okay
let _: EnumWithBothTypealiasAndComputedNone? = .none // Okay

// SR-12063
// https://github.com/apple/swift/issues/54499

let foo1: Foo? = Foo.none
let foo2: Foo?? = Foo.none
Expand Down
2 changes: 1 addition & 1 deletion test/decl/enum/special_case_name.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %target-typecheck-verify-swift -swift-version 5

// https://bugs.swift.org/browse/SR-1660
// https://github.com/apple/swift/issues/44269

enum DayOfTheWeek : Int {
case monday = 0
Expand Down
17 changes: 9 additions & 8 deletions test/decl/ext/extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ extension X3 {
func foo() -> Int { return 0 }
}

// Make sure the test case from https://bugs.swift.org/browse/SR-3847 doesn't
// cause problems when the later extension is incorrectly nested inside another
// declaration.
// Make sure the test case from https://github.com/apple/swift/issues/46432
// doesn't cause problems when the later extension is incorrectly nested inside
// another declaration.
extension C1.NestedStruct {
static let originalValue = 0
}
Expand All @@ -135,7 +135,7 @@ struct WrapperContext {
}

// Class-constrained extension where protocol does not impose class requirement
// SR-11298
// https://github.com/apple/swift/issues/53699

protocol DoesNotImposeClassReq_1 {}

Expand Down Expand Up @@ -352,11 +352,12 @@ extension Tree.BoughPayload.Contents {
// expected-note@-2 {{did you mean to extend 'Nest<Int>' instead?}}
}

// SR-10466 Check 'where' clause when referencing type defined inside extension
struct SR_10466<T> {
var a : A // expected-error {{'SR_10466<T>.A' (aka 'Int') requires the types 'T' and 'Never' be equivalent}}
// https://github.com/apple/swift/issues/52866
// Check 'where' clause when referencing type defined inside extension.
struct S_52866<T> {
var a : A // expected-error {{'S_52866<T>.A' (aka 'Int') requires the types 'T' and 'Never' be equivalent}}
}
extension SR_10466 where T == Never { // expected-note {{requirement specified as 'T' == 'Never' [with T = T]}}
extension S_52866 where T == Never { // expected-note {{requirement specified as 'T' == 'Never' [with T = T]}}
typealias A = Int
}

Expand Down
2 changes: 1 addition & 1 deletion test/decl/ext/generic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ extension Array2 where QQQ : VVV {}
// expected-error@-1 {{cannot find type 'QQQ' in scope}}
// expected-error@-2 {{cannot find type 'VVV' in scope}}

// https://bugs.swift.org/browse/SR-9009
// https://github.com/apple/swift/issues/51512
func foo() {
extension Array where Element : P1 {
// expected-error@-1 {{declaration is only valid at file scope}}
Expand Down
2 changes: 1 addition & 1 deletion test/decl/ext/ordering.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ extension OtherOuter5 {
class Super {}
}

/// SR-5993
/// https://github.com/apple/swift/issues/48550

enum Outer5A {}

Expand Down
4 changes: 3 additions & 1 deletion test/decl/ext/protocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ extension ExtendedProtocol where Self : DerivedWithAlias {
func f4(x: NestedNominal) {}
}

// rdar://problem/21991470 & https://bugs.swift.org/browse/SR-5022
// rdar://problem/21991470
// https://github.com/apple/swift/issues/47598

class NonPolymorphicInit {
init() { } // expected-note {{selected non-required initializer 'init()'}}
}
Expand Down
2 changes: 1 addition & 1 deletion test/decl/ext/specialize.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let _ = [1, 2, 3].makeString() // expected-error 3 {{cannot convert value of typ

extension Set<_> {} // expected-error {{cannot extend a type that contains placeholders}}

// https://bugs.swift.org/browse/SR-4875
// https://github.com/apple/swift/issues/47452

struct Foo<T, U> {
var x: T
Expand Down
5 changes: 4 additions & 1 deletion test/decl/ext/sr_12460.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// RUN: %target-swift-ide-test -print-indexed-symbols -source-filename %s 2>&1 | %FileCheck -check-prefix CHECK %s

// Test that we don't crash when validating members inside an extension with no type name.
// https://github.com/apple/swift/issues/54900
//
// Test that we don't crash when validating members inside an extension with no
// type name.

// CHECK: :[[@LINE+1]]:11: error: expected type name in extension declaration
extension {
Expand Down
2 changes: 1 addition & 1 deletion test/decl/func/default-values-swift4.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public func publicFunctionWithDefaultValue(
y: Int = internalIntFunction()) {}
// expected-error@-1 {{global function 'internalIntFunction()' is internal and cannot be referenced from a default argument value}}

// https://bugs.swift.org/browse/SR-5559
// https://github.com/apple/swift/issues/48131
public class MyClass {
public func method<T>(_: T.Type = T.self) -> T { }
}
Expand Down
23 changes: 14 additions & 9 deletions test/decl/func/default-values.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct X<T> {
let testXa: X<Int> = .foo(i: 0)
let testXb: X<Int> = .bar

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

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

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

class SR_11085_C { init(line: String = #line) {} } // expected-error {{default argument value of type 'Int' cannot be converted to type 'String'}}
let _ = SR_11085_C()
class C { init(line: String = #line) {} } // expected-error {{default argument value of type 'Int' cannot be converted to type 'String'}}
let _ = C()
}

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

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

func genericMagicLiteral<T : ExpressibleByIntegerLiteral>(_ x: T = #line) -> T { x } // expected-note {{where 'T' = 'String'}}
Expand Down
2 changes: 1 addition & 1 deletion test/decl/func/functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func parentheticalInout2(_ fn: (((inout Int)), Int) -> ()) {
fn(&value, 0)
}

// SR-11724
// https://github.com/apple/swift/issues/54133
// FIXME: None of these diagnostics is particularly good.
func bogusDestructuring() {
struct Bar {}
Expand Down
16 changes: 10 additions & 6 deletions test/decl/func/rethrows.swift
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ func testDoRethrow() {
DoRethrowGeneric<Int>().method(fn:) { (a, b) in return a }
}

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


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

infix operator <|: infixr0
infix operator |>: infixl1
Expand Down Expand Up @@ -613,12 +613,16 @@ func rdar_47550715() {
func bar(_: A<F>? = .none) {} // Ok
}

// SR-14270 - test case for diagnostic note 'because_rethrows_default_argument_throws'
// https://github.com/apple/swift/issues/56630
// Test cases for diagnostic note 'because_rethrows_default_argument_throws'

func nonThrowableDefaultRethrows(_ f: () throws -> () = {}) rethrows {
try f()
}
// NOTE: This should compile and not emit a diagnostic because ideally the compiler could statically
// know the default argument value could never throw. See SR-1524.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: should be SR-1534 (see #36455).


// FIXME: This should compile and not emit a diagnostic because ideally the
// compiler could statically know the default argument value could never throw.
// (https://github.com/apple/swift/issues/44143)
nonThrowableDefaultRethrows() // expected-error {{call can throw but is not marked with 'try'}}
// expected-note@-1 {{call is to 'rethrows' function, but a defaulted argument function can throw}}

Expand Down
8 changes: 4 additions & 4 deletions test/decl/func/throwing_functions_without_try.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ func baz2() -> Int {
return x
}

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

protocol SR_11016_P {
protocol P_53406 {
func bar() throws
}

class SR_11016_C {
var foo: SR_11016_P?
class C_53406 {
var foo: P_53406?

func someMethod() throws {
foo?.bar() // expected-error {{call can throw but is not marked with 'try'}}
Expand Down
3 changes: 2 additions & 1 deletion test/decl/func/trailing_closures.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %target-typecheck-verify-swift

// SR-4205: Don't warn about non-trailing closures followed by parameters with
// https://github.com/apple/swift/issues/46788
// Don't warn about non-trailing closures followed by parameters with
// default arguments.
func f1(_ f: () -> (), bar: Int = 10) { } // no-warning
2 changes: 1 addition & 1 deletion test/decl/inherit/inherit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class C : B, A { } // expected-error{{multiple inheritance from classes 'B' and
// Superclass in the wrong position
class D : P, A { } // expected-error{{superclass 'A' must appear first in the inheritance clause}}{{12-15=}}{{11-11=A, }}

// SR-8160
// https://github.com/apple/swift/issues/50692
class D1 : Any, A { } // expected-error{{superclass 'A' must appear first in the inheritance clause}}{{15-18=}}{{12-12=A, }}

class D2 : P & P1, A { } // expected-error{{superclass 'A' must appear first in the inheritance clause}}{{18-21=}}{{12-12=A, }}
Expand Down
20 changes: 10 additions & 10 deletions test/decl/inherit/initializer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,21 @@ func testClassInGenericFunc<T>(t: T) {
}


// <https://bugs.swift.org/browse/SR-5056> Required convenience init inhibits inheritance

class SR5056A {
// https://github.com/apple/swift/issues/47632
// Required convenience 'init' inhibits inheritance
do {
class A {
required init(a: Int) {}
}
}

class SR5056B : SR5056A {
class B : A {
required convenience init(b: Int) {
self.init(a: b)
}
}
}

class SR5056C : SR5056B {}
class C : B {}

func useSR5056C() {
_ = SR5056C(a: 0)
_ = SR5056C(b: 0)
_ = C(a: 0)
_ = C(b: 0)
}
Loading