Skip to content

Commit 6e616cd

Browse files
committed
[CS] Remove an unused function
This was previously used by CSDiag, which is now gone.
1 parent a9870ac commit 6e616cd

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,39 +2226,6 @@ getTypeOfExpressionWithoutApplying(Expr *&expr, DeclContext *dc,
22262226
return exprType;
22272227
}
22282228

2229-
void TypeChecker::getPossibleTypesOfExpressionWithoutApplying(
2230-
Expr *&expr, DeclContext *dc, SmallPtrSetImpl<TypeBase *> &types,
2231-
FreeTypeVariableBinding allowFreeTypeVariables,
2232-
ExprTypeCheckListener *listener) {
2233-
auto &Context = dc->getASTContext();
2234-
FrontendStatsTracer StatsTracer(Context.Stats,
2235-
"get-possible-types-no-apply", expr);
2236-
PrettyStackTraceExpr stackTrace(Context, "type-checking", expr);
2237-
2238-
// Construct a constraint system from this expression.
2239-
ConstraintSystemOptions options;
2240-
options |= ConstraintSystemFlags::ReturnAllDiscoveredSolutions;
2241-
options |= ConstraintSystemFlags::SuppressDiagnostics;
2242-
2243-
ConstraintSystem cs(dc, options);
2244-
2245-
// Attempt to solve the constraint system.
2246-
const Type originalType = expr->getType();
2247-
if (originalType && originalType->hasError())
2248-
expr->setType(Type());
2249-
2250-
SolutionApplicationTarget target(
2251-
expr, dc, CTP_Unused, Type(), /*isDiscarded=*/false);
2252-
if (auto viable = cs.solve(target, listener, allowFreeTypeVariables)) {
2253-
expr = target.getAsExpr();
2254-
for (auto &solution : *viable) {
2255-
auto exprType = solution.simplifyType(cs.getType(expr));
2256-
assert(exprType && !exprType->hasTypeVariable());
2257-
types.insert(exprType.getPointer());
2258-
}
2259-
}
2260-
}
2261-
22622229
static FunctionType *
22632230
getTypeOfCompletionOperatorImpl(DeclContext *DC, Expr *expr,
22642231
ConcreteDeclRef &referencedDecl) {

lib/Sema/TypeChecker.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -839,12 +839,6 @@ class TypeChecker final {
839839
FreeTypeVariableBinding::Disallow,
840840
ExprTypeCheckListener *listener = nullptr);
841841

842-
static void getPossibleTypesOfExpressionWithoutApplying(
843-
Expr *&expr, DeclContext *dc, SmallPtrSetImpl<TypeBase *> &types,
844-
FreeTypeVariableBinding allowFreeTypeVariables =
845-
FreeTypeVariableBinding::Disallow,
846-
ExprTypeCheckListener *listener = nullptr);
847-
848842
/// Return the type of operator function for specified LHS, or a null
849843
/// \c Type on error.
850844
static FunctionType *getTypeOfCompletionOperator(DeclContext *DC, Expr *LHS,

0 commit comments

Comments
 (0)