Skip to content

Commit c02c001

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-rebranch
2 parents d58a1d5 + 3639bc4 commit c02c001

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

lib/IRGen/IRGenFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ class IRGenFunction {
663663
llvm::Value *LocalSelf = nullptr;
664664
/// If set, the dynamic Self type is assumed to be equivalent to this exact class.
665665
CanType LocalSelfType;
666-
bool LocalSelfIsExact;
666+
bool LocalSelfIsExact = false;
667667
LocalSelfKind SelfKind;
668668
};
669669

lib/Parse/SyntaxParsingContext.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,13 @@ ParsedRawSyntaxNode SyntaxParsingContext::finalizeSourceFile() {
258258
Parts = Parts.drop_back();
259259

260260
for (auto RawNode : Parts) {
261-
if (RawNode.getKind() != SyntaxKind::CodeBlockItem)
261+
if (RawNode.getKind() != SyntaxKind::CodeBlockItem) {
262262
// FIXME: Skip toplevel garbage nodes for now. we shouldn't emit them in
263263
// the first place.
264+
if (RawNode.isRecorded())
265+
getSyntaxCreator().finalizeNode(RawNode.getOpaqueNode());
264266
continue;
267+
}
265268

266269
AllTopLevel.push_back(RawNode);
267270
}

lib/Sema/TypeCheckDecl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3501,7 +3501,9 @@ void bindFuncDeclToOperator(TypeChecker &TC, FuncDecl *FD) {
35013501
for (DeclContext *CurContext = FD->getLocalContext();
35023502
!isa<SourceFile>(CurContext);
35033503
CurContext = CurContext->getParent()) {
3504-
insertionLoc = CurContext->getAsDecl()->getStartLoc();
3504+
// Skip over non-decl contexts (e.g. closure expresssions)
3505+
if (auto *D = CurContext->getAsDecl())
3506+
insertionLoc = D->getStartLoc();
35053507
}
35063508
}
35073509

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// RUN: not %target-swift-frontend -typecheck %s
2+
{
3+
static func ??= (lhs: inout Optional, rhs: Optional) {}
4+
}

0 commit comments

Comments
 (0)