Skip to content

Commit 8cd1df4

Browse files
committed
Gardening: Migrate test suite to GH issues: expr/delayed-ident
1 parent b0fb7c5 commit 8cd1df4

File tree

2 files changed

+43
-39
lines changed

2 files changed

+43
-39
lines changed

test/expr/delayed-ident/enum.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ var e2b: E2 = .Second(5)
2626
e2b = .First
2727
var e2c: E2 = .First // expected-error{{generic parameter 'T' could not be inferred}}
2828

29-
// SR-13357
30-
struct SR13357 {}
31-
extension Optional where Wrapped == SR13357 {
32-
static var sr13357: Self { .none }
29+
// https://github.com/apple/swift/issues/55797
30+
31+
struct S_55797 {}
32+
extension Optional where Wrapped == S_55797 {
33+
static var v55797: Self { .none }
3334
}
3435

35-
func f_sr13357<T>(_: T?) { }
36+
func f_55797<T>(_: T?) { }
3637

37-
f_sr13357(.sr13357)
38+
f_55797(.v55797)
Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,50 @@
11
// RUN: %target-typecheck-verify-swift -dump-ast > %t.dump
22
// RUN: %FileCheck %s < %t.dump
33

4-
// SR-13815
4+
// https://github.com/apple/swift/issues/56212
5+
56
extension Optional {
6-
func sr13815() -> SR13815? { SR13815() }
7-
static func sr13815_2() -> SR13815? { SR13815() }
8-
static func sr13815_3() -> SR13815? { SR13815() }
9-
static var sr13815_wrongType: Int { 0 }
10-
static var sr13815_overload: SR13815 { SR13815() }
11-
init(overloaded: Void) { self = nil }
7+
func member1() -> S1? {}
8+
static func member2() -> S1? {}
9+
static func member3() -> S1? {}
10+
static var member_wrongType: Int { get {} }
11+
static var member_overload: S1 { get {} }
12+
13+
init(overloaded: Void) {}
14+
}
15+
16+
protocol P1 {}
17+
extension Optional: P1 where Wrapped: Equatable {
18+
static func member4() {}
1219
}
1320

14-
struct SR13815 {
15-
static var sr13815: SR13815? = SR13815()
16-
static var sr13815_2: SR13815? = SR13815()
17-
static var sr13815_wrongType: SR13815? { SR13815() }
18-
static var p_SR13815: SR13815? { SR13815() }
19-
static func sr13815_3() -> SR13815? { SR13815() }
20-
static var sr13815_overload: SR13815? { SR13815() }
21+
struct S1 {
22+
static var member1: S1? = S1()
23+
static var member2: S1? = S1()
24+
static func member3() -> S1? {}
25+
static var member4: S1? { get {} }
26+
static var member_wrongType: S1? { get {} }
27+
static var member_overload: S1? { get {} }
28+
2129
init(overloaded: Void) {}
2230
init?(failable: Void) {}
2331
init() {}
2432
}
2533

26-
protocol P_SR13815 {}
27-
extension Optional: P_SR13815 where Wrapped: Equatable {
28-
static func p_SR13815() {}
29-
}
30-
31-
let _: SR13815? = .sr13815
32-
let _: SR13815? = .sr13815_wrongType
33-
let _: SR13815? = .init()
34-
let _: SR13815? = .sr13815() // expected-error {{instance member 'sr13815' cannot be used on type 'SR13815?'}}
35-
let _: SR13815? = .sr13815_2()
36-
let _: SR13815? = .init(SR13815())
37-
let _: SR13815? = .init(overloaded: ())
34+
let _: S1? = .member1
35+
let _: S1? = .member_wrongType
36+
let _: S1? = .init()
37+
let _: S1? = .member1() // expected-error {{instance member 'member1' cannot be used on type 'S1?'}}
38+
let _: S1? = .member2()
39+
let _: S1? = .init(S1())
40+
let _: S1? = .init(overloaded: ())
3841
// If members exist on Optional and Wrapped, always choose the one on optional
39-
// CHECK: declref_expr {{.*}} location={{.*}}optional_overload.swift:37
42+
// CHECK: declref_expr {{.*}} location={{.*}}optional_overload.swift:40
4043
// CHECK-SAME: decl=optional_overload.(file).Optional extension.init(overloaded:)
41-
let _: SR13815? = .sr13815_overload
44+
let _: S1? = .member_overload
4245
// Should choose the overload from Optional even if the Wrapped overload would otherwise have a better score
43-
// CHECK: member_ref_expr {{.*}} location={{.*}}optional_overload.swift:41
44-
// CHECK-SAME: decl=optional_overload.(file).Optional extension.sr13815_overload
45-
let _: SR13815? = .init(failable: ())
46-
let _: SR13815? = .sr13815_3()
47-
let _: SR13815? = .p_SR13815
46+
// CHECK: member_ref_expr {{.*}} location={{.*}}optional_overload.swift:44
47+
// CHECK-SAME: decl=optional_overload.(file).Optional extension.member_overload
48+
let _: S1? = .init(failable: ())
49+
let _: S1? = .member3()
50+
let _: S1? = .member4

0 commit comments

Comments
 (0)