Skip to content

Commit f78fe28

Browse files
committed
[LangOptions] Remove the option to enable/disable implicit existential
opening.
1 parent 3f7d1b1 commit f78fe28

File tree

10 files changed

+8
-24
lines changed

10 files changed

+8
-24
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,6 @@ namespace swift {
334334
/// `func f() -> <T> T`.
335335
bool EnableExperimentalNamedOpaqueTypes = false;
336336

337-
/// Enable support for implicitly opening existential argument types
338-
/// in calls to generic functions.
339-
bool EnableOpenedExistentialTypes = false;
340-
341337
/// Enable experimental flow-sensitive concurrent captures.
342338
bool EnableExperimentalFlowSensitiveConcurrentCaptures = false;
343339

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
456456
Opts.EnableExperimentalNamedOpaqueTypes |=
457457
Args.hasArg(OPT_enable_experimental_named_opaque_types);
458458

459-
Opts.EnableOpenedExistentialTypes =
460-
Args.hasFlag(OPT_enable_experimental_opened_existential_types,
461-
OPT_disable_experimental_opened_existential_types,
462-
true);
463-
464459
Opts.EnableExperimentalVariadicGenerics |=
465460
Args.hasArg(OPT_enable_experimental_variadic_generics);
466461

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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop)
2-
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop -Xfrontend -enable-experimental-opened-existential-types)
32
//
43
// REQUIRES: executable_test
54

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)