Skip to content

Commit 6e8a581

Browse files
committed
[LangOptions] Remove the option to enable/disable implicit existential
opening.
1 parent 04bbde1 commit 6e8a581

File tree

10 files changed

+9
-25
lines changed

10 files changed

+9
-25
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,6 @@ namespace swift {
313313
/// Enable experimental concurrency model.
314314
bool EnableExperimentalConcurrency = false;
315315

316-
/// Enable support for implicitly opening existential argument types
317-
/// in calls to generic functions.
318-
bool EnableOpenedExistentialTypes = false;
319-
320316
/// Disable experimental ClangImporter diagnostics.
321317
bool DisableExperimentalClangImporterDiagnostics = false;
322318

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
450450
Opts.EnableExperimentalConcurrency |=
451451
Args.hasArg(OPT_enable_experimental_concurrency);
452452

453-
Opts.EnableOpenedExistentialTypes =
454-
Args.hasFlag(OPT_enable_experimental_opened_existential_types,
455-
OPT_disable_experimental_opened_existential_types,
456-
true);
457-
458453
Opts.EnableInferPublicSendable |=
459454
Args.hasFlag(OPT_enable_infer_public_concurrent_value,
460455
OPT_disable_infer_public_concurrent_value,

lib/Sema/CSSimplify.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,10 +1519,6 @@ shouldOpenExistentialCallArgument(
15191519
if (isa_and_nonnull<clang::FunctionTemplateDecl>(callee->getClangDecl()))
15201520
return None;
15211521

1522-
ASTContext &ctx = callee->getASTContext();
1523-
if (!ctx.LangOpts.EnableOpenedExistentialTypes)
1524-
return None;
1525-
15261522
// The actual parameter type needs to involve a type variable, otherwise
15271523
// type inference won't be possible.
15281524
if (!paramTy->hasTypeVariable())

test/Constraints/openExistential.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %target-typecheck-verify-swift
2-
// RUN: %target-typecheck-verify-swift -enable-experimental-opened-existential-types
32

43
protocol P { }
54

test/Constraints/opened_existentials.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -enable-experimental-opened-existential-types
1+
// RUN: %target-typecheck-verify-swift
22

33
protocol Q { }
44

test/Constraints/opened_existentials_suppression.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -enable-experimental-opened-existential-types -typecheck -dump-ast -parse-as-library %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -typecheck -dump-ast -parse-as-library %s | %FileCheck %s
22

33
protocol P { }
44
extension Optional: P where Wrapped: P { }

test/Constraints/result_builder_availability.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.50
2-
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.50 -enable-experimental-opened-existential-types
32

43
// REQUIRES: OS=macosx
54

test/Generics/existential_restrictions.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -enable-objc-interop -disable-experimental-opened-existential-types
1+
// RUN: %target-typecheck-verify-swift -enable-objc-interop
22

33
protocol P { }
44
@objc protocol OP { }
@@ -8,14 +8,14 @@ protocol CP : class { }
88
static func createNewOne() -> SP
99
}
1010

11-
func fP<T : P>(_ t: T) { }
11+
func fP<T : P>(_ t: T?) { }
1212
// expected-note@-1 {{required by global function 'fP' where 'T' = 'any P'}}
1313
// expected-note@-2 {{required by global function 'fP' where 'T' = 'any OP & P'}}
14-
func fOP<T : OP>(_ t: T) { }
14+
func fOP<T : OP>(_ t: T?) { }
1515
// expected-note@-1 {{required by global function 'fOP' where 'T' = 'any OP & P'}}
1616
func fOPE(_ t: OP) { }
17-
func fSP<T : SP>(_ t: T) { }
18-
func fAO<T : AnyObject>(_ t: T) { }
17+
func fSP<T : SP>(_ t: T?) { }
18+
func fAO<T : AnyObject>(_ t: T?) { }
1919
// expected-note@-1 {{where 'T' = 'any P'}}
2020
// expected-note@-2 {{where 'T' = 'any CP'}}
2121
// expected-note@-3 {{where 'T' = 'any OP & P'}}

test/Interop/Cxx/templates/function-template.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop)
2-
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop -Xfrontend -enable-experimental-opened-existential-types)
3-
//
2+
43
// REQUIRES: executable_test
54

65
import FunctionTemplates

test/SILGen/opened_existentials.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen -enable-experimental-opened-existential-types %s | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
22

33
public protocol P { }
44

0 commit comments

Comments
 (0)