Skip to content

Commit 77daaf3

Browse files
author
Nathan Hawes
committed
[ASTVerifier] Don't perform semantic requests in verifyParsed()
SourceKit doesn't install a typechecker for its syntactic requests so was hitting assertions in these methods if any typechecking was triggered.
1 parent 125c1fb commit 77daaf3

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

lib/AST/ASTVerifier.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2866,15 +2866,6 @@ class Verifier : public ASTWalker {
28662866

28672867
void verifyParsed(ConstructorDecl *CD) {
28682868
PrettyStackTraceDecl debugStack("verifying ConstructorDecl", CD);
2869-
2870-
auto *DC = CD->getDeclContext();
2871-
if (!isa<NominalTypeDecl>(DC) && !isa<ExtensionDecl>(DC) &&
2872-
!CD->isInvalid()) {
2873-
Out << "ConstructorDecls outside nominal types and extensions "
2874-
"should be marked invalid";
2875-
abort();
2876-
}
2877-
28782869
verifyParsedBase(CD);
28792870
}
28802871

@@ -2955,15 +2946,6 @@ class Verifier : public ASTWalker {
29552946
Out << "DestructorDecl cannot be generic";
29562947
abort();
29572948
}
2958-
2959-
auto *DC = DD->getDeclContext();
2960-
if (!isa<NominalTypeDecl>(DC) && !isa<ExtensionDecl>(DC) &&
2961-
!DD->isInvalid()) {
2962-
Out << "DestructorDecls outside nominal types and extensions "
2963-
"should be marked invalid";
2964-
abort();
2965-
}
2966-
29672949
verifyParsedBase(DD);
29682950
}
29692951

test/SourceKit/DocumentStructure/Inputs/main.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,11 @@ class OneMore {
139139
class Chain<A> {
140140
func + (lhs: Chain<A>, rhs: Chain<A>) -> Chain<A> { fatalError() }
141141
}
142+
143+
public init() {
144+
fatalError()
145+
}
146+
147+
deinit {
148+
fatalError()
149+
}

0 commit comments

Comments
 (0)