@@ -2172,6 +2172,7 @@ Type TypeChecker::typeCheckExpressionImpl(Expr *&expr, DeclContext *dc,
2172
2172
TypeCheckExprOptions options,
2173
2173
ExprTypeCheckListener &listener,
2174
2174
ConstraintSystem *baseCS) {
2175
+ auto &Context = dc->getASTContext ();
2175
2176
FrontendStatsTracer StatsTracer (Context.Stats , " typecheck-expr" , expr);
2176
2177
PrettyStackTraceExpr stackTrace (Context, " type-checking" , expr);
2177
2178
@@ -3717,22 +3718,22 @@ void ConstraintSystem::print(raw_ostream &out) const {
3717
3718
out << " \n Active Constraints:\n " ;
3718
3719
for (auto &constraint : ActiveConstraints) {
3719
3720
out.indent (2 );
3720
- constraint.print (out, &getTypeChecker (). Context .SourceMgr );
3721
+ constraint.print (out, &getASTContext () .SourceMgr );
3721
3722
out << " \n " ;
3722
3723
}
3723
3724
3724
3725
out << " \n Inactive Constraints:\n " ;
3725
3726
for (auto &constraint : InactiveConstraints) {
3726
3727
out.indent (2 );
3727
- constraint.print (out, &getTypeChecker (). Context .SourceMgr );
3728
+ constraint.print (out, &getASTContext () .SourceMgr );
3728
3729
out << " \n " ;
3729
3730
}
3730
3731
3731
3732
if (solverState && !solverState->hasRetiredConstraints ()) {
3732
3733
out << " \n Retired Constraints:\n " ;
3733
3734
solverState->forEachRetired ([&](Constraint &constraint) {
3734
3735
out.indent (2 );
3735
- constraint.print (out, &getTypeChecker (). Context .SourceMgr );
3736
+ constraint.print (out, &getASTContext () .SourceMgr );
3736
3737
out << " \n " ;
3737
3738
});
3738
3739
}
@@ -3786,7 +3787,7 @@ void ConstraintSystem::print(raw_ostream &out) const {
3786
3787
out << " \n Disjunction choices:\n " ;
3787
3788
for (auto &choice : DisjunctionChoices) {
3788
3789
out.indent (2 );
3789
- choice.first ->dump (&getTypeChecker (). Context .SourceMgr , out);
3790
+ choice.first ->dump (&getASTContext () .SourceMgr , out);
3790
3791
out << " is #" << choice.second << " \n " ;
3791
3792
}
3792
3793
}
@@ -3795,7 +3796,7 @@ void ConstraintSystem::print(raw_ostream &out) const {
3795
3796
out << " \n Opened types:\n " ;
3796
3797
for (const auto &opened : OpenedTypes) {
3797
3798
out.indent (2 );
3798
- opened.first ->dump (&getTypeChecker (). Context .SourceMgr , out);
3799
+ opened.first ->dump (&getASTContext () .SourceMgr , out);
3799
3800
out << " opens " ;
3800
3801
interleave (opened.second .begin (), opened.second .end (),
3801
3802
[&](OpenedType opened) {
@@ -3814,7 +3815,7 @@ void ConstraintSystem::print(raw_ostream &out) const {
3814
3815
out << " \n Opened existential types:\n " ;
3815
3816
for (const auto &openedExistential : OpenedExistentialTypes) {
3816
3817
out.indent (2 );
3817
- openedExistential.first ->dump (&getTypeChecker (). Context .SourceMgr , out);
3818
+ openedExistential.first ->dump (&getASTContext () .SourceMgr , out);
3818
3819
out << " opens to " << openedExistential.second ->getString (PO);
3819
3820
out << " \n " ;
3820
3821
}
@@ -3823,7 +3824,7 @@ void ConstraintSystem::print(raw_ostream &out) const {
3823
3824
if (!DefaultedConstraints.empty ()) {
3824
3825
out << " \n Defaulted constraints: " ;
3825
3826
interleave (DefaultedConstraints, [&](ConstraintLocator *locator) {
3826
- locator->dump (&getTypeChecker (). Context .SourceMgr , out);
3827
+ locator->dump (&getASTContext () .SourceMgr , out);
3827
3828
}, [&] {
3828
3829
out << " , " ;
3829
3830
});
@@ -3832,7 +3833,7 @@ void ConstraintSystem::print(raw_ostream &out) const {
3832
3833
if (failedConstraint) {
3833
3834
out << " \n Failed constraint:\n " ;
3834
3835
out.indent (2 );
3835
- failedConstraint->print (out, &getTypeChecker (). Context .SourceMgr );
3836
+ failedConstraint->print (out, &getASTContext () .SourceMgr );
3836
3837
out << " \n " ;
3837
3838
}
3838
3839
0 commit comments