Skip to content

Commit f4fa6ea

Browse files
committed
some hacks
1 parent c3d0bae commit f4fa6ea

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/Parse/ParseExpr.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,9 @@ Parser::parseExprPostfixSuffix(ParserResult<Expr> Result, bool isExprBasic,
15551555
if (!Tok.isAtStartOfLine() && Tok.is(tok::unknown)) {
15561556
SourceLoc UnknownLoc = consumeToken();
15571557
SourceRange ErrorRange = Result.get()->getSourceRange();
1558+
if (SourceMgr.rangeContainsIDEInspectionTarget(Lexer::getCharSourceRangeFromSourceRange(SourceMgr, ErrorRange))) {
1559+
continue;
1560+
}
15581561
ErrorRange.widen(UnknownLoc);
15591562
Result = makeParserResult(Result, new (Context) ErrorExpr(ErrorRange,
15601563
Type(),

lib/Sema/TypeCheckStmt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2672,7 +2672,8 @@ bool TypeCheckASTNodeAtLocRequest::evaluate(
26722672
// apply the solution.
26732673
// FIXME: We ought to see if we can do better in that case.
26742674
if (auto *CE = DC->getInnermostClosureForCaptures()) {
2675-
if (CE->getBodyState() == ClosureExpr::BodyState::Parsed) {
2675+
if (CE->getBodyState() == ClosureExpr::BodyState::Parsed &&
2676+
!typeCheckCtx.isForUnattachedNode()) {
26762677
swift::typeCheckASTNodeAtLoc(
26772678
TypeCheckASTNodeAtLocContext::declContext(CE->getParent()),
26782679
CE->getLoc());

0 commit comments

Comments
 (0)