Skip to content

Commit a84972b

Browse files
authored
Merge pull request #25976 from DougGregor/drop-enable-opaque-result-types
2 parents c6b8ae5 + d0c5b6a commit a84972b

File tree

6 files changed

+4
-18
lines changed

6 files changed

+4
-18
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,6 @@ namespace swift {
314314
/// and faster rebuilds.
315315
bool EnableExperimentalDependencies = false;
316316

317-
/// Enable the experimental opaque result types feature.
318-
bool EnableOpaqueResultTypes = true;
319-
320317
/// To mimic existing system, set to false.
321318
/// To experiment with including file-private and private dependency info,
322319
/// set to true.

include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,6 @@ def solver_enable_operator_designated_types :
413413
Flag<["-"], "solver-enable-operator-designated-types">,
414414
HelpText<"Enable operator designated types in constraint solver">;
415415

416-
def enable_opaque_result_types :
417-
Flag<["-"], "enable-opaque-result-types">,
418-
HelpText<"Enable experimental opaque result types feature">;
419-
420416
def switch_checking_invocation_threshold_EQ : Joined<["-"],
421417
"switch-checking-invocation-threshold=">;
422418

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
276276
Opts.EnableOperatorDesignatedTypes |=
277277
Args.hasArg(OPT_enable_operator_designated_types);
278278

279-
Opts.EnableOpaqueResultTypes |=
280-
Args.hasArg(OPT_enable_opaque_result_types);
281-
282279
// Always enable operator designated types for the standard library.
283280
Opts.EnableOperatorDesignatedTypes |= FrontendOpts.ParseStdlib;
284281

lib/Parse/ParseType.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,7 @@ Parser::parseTypeSimpleOrComposition(Diag<> MessageID,
697697
// This is only semantically allowed in certain contexts, but we parse it
698698
// generally for diagnostics and recovery.
699699
SourceLoc opaqueLoc;
700-
if (Context.LangOpts.EnableOpaqueResultTypes
701-
&& Tok.is(tok::identifier)
702-
&& Tok.getRawText() == "some") {
700+
if (Tok.is(tok::identifier) && Tok.getRawText() == "some") {
703701
// Treat some as a keyword.
704702
TokReceiver->registerTokenKindChange(Tok.getLoc(), tok::contextual_keyword);
705703
opaqueLoc = consumeToken();
@@ -765,9 +763,7 @@ Parser::parseTypeSimpleOrComposition(Diag<> MessageID,
765763
}
766764

767765
// Diagnose invalid `some` after an ampersand.
768-
if (Context.LangOpts.EnableOpaqueResultTypes
769-
&& Tok.is(tok::identifier)
770-
&& Tok.getRawText() == "some") {
766+
if (Tok.is(tok::identifier) && Tok.getRawText() == "some") {
771767
auto badLoc = consumeToken();
772768

773769
// TODO: Fixit to move to beginning of composition.

test/Constraints/function_builder_diags.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 -disable-availability-checking -enable-opaque-result-types
1+
// RUN: %target-typecheck-verify-swift -disable-availability-checking
22

33
@_functionBuilder
44
struct TupleBuilder { // expected-note 2{{struct 'TupleBuilder' declared here}}

test/type/opaque.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -disable-availability-checking -typecheck -verify -enable-opaque-result-types %s
1+
// RUN: %target-swift-frontend -disable-availability-checking -typecheck -verify %s
22

33
protocol P {
44
func paul()

0 commit comments

Comments
 (0)