mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[LangOptions] Remove the option to enable/disable implicit existential
opening.
This commit is contained in:
@@ -313,10 +313,6 @@ namespace swift {
|
||||
/// Enable experimental concurrency model.
|
||||
bool EnableExperimentalConcurrency = false;
|
||||
|
||||
/// Enable support for implicitly opening existential argument types
|
||||
/// in calls to generic functions.
|
||||
bool EnableOpenedExistentialTypes = false;
|
||||
|
||||
/// Disable experimental ClangImporter diagnostics.
|
||||
bool DisableExperimentalClangImporterDiagnostics = false;
|
||||
|
||||
|
||||
@@ -450,11 +450,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
Opts.EnableExperimentalConcurrency |=
|
||||
Args.hasArg(OPT_enable_experimental_concurrency);
|
||||
|
||||
Opts.EnableOpenedExistentialTypes =
|
||||
Args.hasFlag(OPT_enable_experimental_opened_existential_types,
|
||||
OPT_disable_experimental_opened_existential_types,
|
||||
true);
|
||||
|
||||
Opts.EnableInferPublicSendable |=
|
||||
Args.hasFlag(OPT_enable_infer_public_concurrent_value,
|
||||
OPT_disable_infer_public_concurrent_value,
|
||||
|
||||
@@ -1519,10 +1519,6 @@ shouldOpenExistentialCallArgument(
|
||||
if (isa_and_nonnull<clang::FunctionTemplateDecl>(callee->getClangDecl()))
|
||||
return None;
|
||||
|
||||
ASTContext &ctx = callee->getASTContext();
|
||||
if (!ctx.LangOpts.EnableOpenedExistentialTypes)
|
||||
return None;
|
||||
|
||||
// The actual parameter type needs to involve a type variable, otherwise
|
||||
// type inference won't be possible.
|
||||
if (!paramTy->hasTypeVariable())
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// RUN: %target-typecheck-verify-swift
|
||||
// RUN: %target-typecheck-verify-swift -enable-experimental-opened-existential-types
|
||||
|
||||
protocol P { }
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %target-typecheck-verify-swift -enable-experimental-opened-existential-types
|
||||
// RUN: %target-typecheck-verify-swift
|
||||
|
||||
protocol Q { }
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %target-swift-frontend -enable-experimental-opened-existential-types -typecheck -dump-ast -parse-as-library %s | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -typecheck -dump-ast -parse-as-library %s | %FileCheck %s
|
||||
|
||||
protocol P { }
|
||||
extension Optional: P where Wrapped: P { }
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.50
|
||||
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.50 -enable-experimental-opened-existential-types
|
||||
|
||||
// REQUIRES: OS=macosx
|
||||
|
||||
|
||||
@@ -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?) { }
|
||||
// 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'}}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop)
|
||||
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop -Xfrontend -enable-experimental-opened-existential-types)
|
||||
//
|
||||
|
||||
// REQUIRES: executable_test
|
||||
|
||||
import FunctionTemplates
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %target-swift-emit-silgen -enable-experimental-opened-existential-types %s | %FileCheck %s
|
||||
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
|
||||
|
||||
public protocol P { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user