Skip to content

Commit 02f9990

Browse files
committed
[CS] NFC: Move some code
Always bothered me the constructor for ExprRewriter is buried in the middle of the class.
1 parent bb58cbc commit 02f9990

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/Sema/CSApply.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,15 @@ namespace {
415415
std::optional<SyntacticElementTarget> target;
416416
bool SuppressDiagnostics;
417417

418+
ExprRewriter(ConstraintSystem &cs, Solution &solution,
419+
std::optional<SyntacticElementTarget> target,
420+
bool suppressDiagnostics)
421+
: cs(cs), dc(target ? target->getDeclContext() : cs.DC),
422+
solution(solution), target(target),
423+
SuppressDiagnostics(suppressDiagnostics) {}
424+
425+
ConstraintSystem &getConstraintSystem() const { return cs; }
426+
418427
/// Coerce the given tuple to another tuple type.
419428
///
420429
/// \param expr The expression we're converting.
@@ -2631,15 +2640,6 @@ namespace {
26312640
}
26322641

26332642
public:
2634-
ExprRewriter(ConstraintSystem &cs, Solution &solution,
2635-
std::optional<SyntacticElementTarget> target,
2636-
bool suppressDiagnostics)
2637-
: cs(cs), dc(target ? target->getDeclContext() : cs.DC),
2638-
solution(solution), target(target),
2639-
SuppressDiagnostics(suppressDiagnostics) {}
2640-
2641-
ConstraintSystem &getConstraintSystem() const { return cs; }
2642-
26432643
/// Simplify the expression type and return the expression.
26442644
///
26452645
/// This routine is used for 'simple' expressions that only need their

0 commit comments

Comments
 (0)