Skip to content

Commit 4d1a04b

Browse files
authored
[CS] Remove AllowUnresolvedTypeVariables (swiftlang#84146)
This has been unused for a while now.
2 parents cac98f3 + 23560df commit 4d1a04b

File tree

3 files changed

+7
-27
lines changed

3 files changed

+7
-27
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,13 +1937,6 @@ enum class ConstraintSystemFlags {
19371937
/// Set if the client wants diagnostics suppressed.
19381938
SuppressDiagnostics = 0x02,
19391939

1940-
/// If set, the client wants a best-effort solution to the constraint system,
1941-
/// but can tolerate a solution where all of the constraints are solved, but
1942-
/// not all type variables have been determined. In this case, the constraint
1943-
/// system is not applied to the expression AST, but the ConstraintSystem is
1944-
/// left in-tact.
1945-
AllowUnresolvedTypeVariables = 0x04,
1946-
19471940
/// If set, verbose output is enabled for this constraint system.
19481941
///
19491942
/// Note that this flag is automatically applied to all constraint systems,
@@ -1952,12 +1945,12 @@ enum class ConstraintSystemFlags {
19521945
/// \c DebugConstraintSolverAttempt. Finally, it can also be automatically
19531946
/// enabled for a pre-configured set of expressions on line numbers by setting
19541947
/// \c DebugConstraintSolverOnLines.
1955-
DebugConstraints = 0x08,
1948+
DebugConstraints = 0x04,
19561949

19571950
/// If set, we are solving specifically to determine the type of a
19581951
/// CodeCompletionExpr, and should continue in the presence of errors wherever
19591952
/// possible.
1960-
ForCodeCompletion = 0x10,
1953+
ForCodeCompletion = 0x08,
19611954

19621955
/// Include Clang function types when checking equality for function types.
19631956
///
@@ -1968,16 +1961,16 @@ enum class ConstraintSystemFlags {
19681961
/// should be treated as semantically different, as they may have different
19691962
/// calling conventions, say due to Clang attributes such as
19701963
/// `__attribute__((ns_consumed))`.
1971-
UseClangFunctionTypes = 0x20,
1964+
UseClangFunctionTypes = 0x10,
19721965

19731966
/// When set, ignore async/sync mismatches
1974-
IgnoreAsyncSyncMismatch = 0x40,
1967+
IgnoreAsyncSyncMismatch = 0x20,
19751968

19761969
/// Disable macro expansions.
1977-
DisableMacroExpansions = 0x80,
1970+
DisableMacroExpansions = 0x40,
19781971

19791972
/// Enable old type-checker performance hacks.
1980-
EnablePerformanceHacks = 0x100,
1973+
EnablePerformanceHacks = 0x80,
19811974
};
19821975

19831976
/// Options that affect the constraint system as a whole.

lib/Sema/CSSolver.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,16 +1488,6 @@ ConstraintSystem::solve(SyntacticElementTarget &target,
14881488
return std::nullopt;
14891489
}
14901490

1491-
if (Options.contains(
1492-
ConstraintSystemFlags::AllowUnresolvedTypeVariables)) {
1493-
dumpSolutions(solution);
1494-
auto ambiguousSolutions = std::move(solution).takeAmbiguousSolutions();
1495-
std::vector<Solution> result(
1496-
std::make_move_iterator(ambiguousSolutions.begin()),
1497-
std::make_move_iterator(ambiguousSolutions.end()));
1498-
return std::move(result);
1499-
}
1500-
15011491
LLVM_FALLTHROUGH;
15021492

15031493
case SolutionResult::UndiagnosedError:

unittests/Sema/BindingInferenceTests.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ using namespace swift::constraints;
2222
using namespace swift::constraints::inference;
2323

2424
TEST_F(SemaTest, TestIntLiteralBindingInference) {
25-
ConstraintSystemOptions options;
26-
options |= ConstraintSystemFlags::AllowUnresolvedTypeVariables;
27-
28-
ConstraintSystem cs(DC, options);
25+
ConstraintSystem cs(DC, std::nullopt);
2926

3027
auto *intLiteral = IntegerLiteralExpr::createFromUnsigned(Context, 42, SourceLoc());
3128

0 commit comments

Comments
 (0)