-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[LangOptions] Remove the option to enable/disable implicit existential opening. #59740
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// RUN: %target-typecheck-verify-swift -enable-objc-interop -disable-experimental-opened-existential-types | ||
// RUN: %target-typecheck-verify-swift -enable-objc-interop | ||
|
||
protocol P { } | ||
@objc protocol OP { } | ||
|
@@ -8,14 +8,14 @@ protocol CP : class { } | |
static func createNewOne() -> SP | ||
} | ||
|
||
func fP<T : P>(_ t: T) { } | ||
func fP<T : P>(_ t: T?) { } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the addition of '?' in this file intentional? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I made these parameters optional so the diagnostics stay the same later in the file (instead of disappearing due to opening) |
||
// expected-note@-1 {{required by global function 'fP' where 'T' = 'any P'}} | ||
// expected-note@-2 {{required by global function 'fP' where 'T' = 'any OP & P'}} | ||
func fOP<T : OP>(_ t: T) { } | ||
func fOP<T : OP>(_ t: T?) { } | ||
// expected-note@-1 {{required by global function 'fOP' where 'T' = 'any OP & P'}} | ||
func fOPE(_ t: OP) { } | ||
func fSP<T : SP>(_ t: T) { } | ||
func fAO<T : AnyObject>(_ t: T) { } | ||
func fSP<T : SP>(_ t: T?) { } | ||
func fAO<T : AnyObject>(_ t: T?) { } | ||
// expected-note@-1 {{where 'T' = 'any P'}} | ||
// expected-note@-2 {{where 'T' = 'any CP'}} | ||
// expected-note@-3 {{where 'T' = 'any OP & P'}} | ||
|
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.
Make sense to me! If I understand correctly, code completion doesn't care about the structure of the argument but the fact that the argument has a particular type it could use to infer right-hand side of the operator.
/cc @ahoppen
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.
Yes, we only care about the type. We might even be able to get rid of the
ConstraintSystemFlags::ReusePrecheckedType
option above. Not entirely sure though.