-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Gardening: Migrate test suite to GH issues p. 13 #60836
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
AnthonyLatsis
merged 4 commits into
swiftlang:main
from
AnthonyLatsis:migrate-test-suite-to-gh-issues-13
Sep 2, 2022
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8cd1df4
Gardening: Migrate test suite to GH issues: expr/delayed-ident
AnthonyLatsis 2a220d5
Gardening: Migrate test suite to GH issues: expr/postfix
AnthonyLatsis 65663b0
Gardening: Migrate test suite to GH issues: expr/primary
AnthonyLatsis d911aad
Gardening: Migrate test suite to GH issues: expr/unary
AnthonyLatsis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,50 @@ | ||
// RUN: %target-typecheck-verify-swift -dump-ast > %t.dump | ||
// RUN: %FileCheck %s < %t.dump | ||
|
||
// SR-13815 | ||
// https://github.com/apple/swift/issues/56212 | ||
|
||
extension Optional { | ||
func sr13815() -> SR13815? { SR13815() } | ||
static func sr13815_2() -> SR13815? { SR13815() } | ||
static func sr13815_3() -> SR13815? { SR13815() } | ||
static var sr13815_wrongType: Int { 0 } | ||
static var sr13815_overload: SR13815 { SR13815() } | ||
init(overloaded: Void) { self = nil } | ||
func member1() -> S1? {} | ||
static func member2() -> S1? {} | ||
static func member3() -> S1? {} | ||
static var member_wrongType: Int { get {} } | ||
static var member_overload: S1 { get {} } | ||
|
||
init(overloaded: Void) {} | ||
} | ||
|
||
protocol P1 {} | ||
extension Optional: P1 where Wrapped: Equatable { | ||
static func member4() {} | ||
} | ||
|
||
struct SR13815 { | ||
static var sr13815: SR13815? = SR13815() | ||
static var sr13815_2: SR13815? = SR13815() | ||
static var sr13815_wrongType: SR13815? { SR13815() } | ||
static var p_SR13815: SR13815? { SR13815() } | ||
static func sr13815_3() -> SR13815? { SR13815() } | ||
static var sr13815_overload: SR13815? { SR13815() } | ||
struct S1 { | ||
static var member1: S1? = S1() | ||
static var member2: S1? = S1() | ||
static func member3() -> S1? {} | ||
static var member4: S1? { get {} } | ||
static var member_wrongType: S1? { get {} } | ||
static var member_overload: S1? { get {} } | ||
|
||
init(overloaded: Void) {} | ||
init?(failable: Void) {} | ||
init() {} | ||
} | ||
|
||
protocol P_SR13815 {} | ||
extension Optional: P_SR13815 where Wrapped: Equatable { | ||
static func p_SR13815() {} | ||
} | ||
|
||
let _: SR13815? = .sr13815 | ||
let _: SR13815? = .sr13815_wrongType | ||
let _: SR13815? = .init() | ||
let _: SR13815? = .sr13815() // expected-error {{instance member 'sr13815' cannot be used on type 'SR13815?'}} | ||
let _: SR13815? = .sr13815_2() | ||
let _: SR13815? = .init(SR13815()) | ||
let _: SR13815? = .init(overloaded: ()) | ||
let _: S1? = .member1 | ||
let _: S1? = .member_wrongType | ||
let _: S1? = .init() | ||
let _: S1? = .member1() // expected-error {{instance member 'member1' cannot be used on type 'S1?'}} | ||
let _: S1? = .member2() | ||
let _: S1? = .init(S1()) | ||
let _: S1? = .init(overloaded: ()) | ||
// If members exist on Optional and Wrapped, always choose the one on optional | ||
// CHECK: declref_expr {{.*}} location={{.*}}optional_overload.swift:37 | ||
// CHECK: declref_expr {{.*}} location={{.*}}optional_overload.swift:40 | ||
// CHECK-SAME: decl=optional_overload.(file).Optional extension.init(overloaded:) | ||
let _: SR13815? = .sr13815_overload | ||
let _: S1? = .member_overload | ||
// Should choose the overload from Optional even if the Wrapped overload would otherwise have a better score | ||
// CHECK: member_ref_expr {{.*}} location={{.*}}optional_overload.swift:41 | ||
// CHECK-SAME: decl=optional_overload.(file).Optional extension.sr13815_overload | ||
let _: SR13815? = .init(failable: ()) | ||
let _: SR13815? = .sr13815_3() | ||
let _: SR13815? = .p_SR13815 | ||
// CHECK: member_ref_expr {{.*}} location={{.*}}optional_overload.swift:44 | ||
// CHECK-SAME: decl=optional_overload.(file).Optional extension.member_overload | ||
let _: S1? = .init(failable: ()) | ||
let _: S1? = .member3() | ||
let _: S1? = .member4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test case on this line is a dupe (see old line 56)—deleted it.