Skip to content

Commit e8fe05d

Browse files
committed
[AST] hasValueSemantics() should check whether the current context is a type context before proceeding
1 parent 29ca8b0 commit e8fe05d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/AST/DeclContext.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,9 @@ DeclContextKind DeclContext::getContextKind() const {
10251025
}
10261026

10271027
bool DeclContext::hasValueSemantics() const {
1028+
if (!isTypeContext())
1029+
return false;
1030+
10281031
if (auto contextTy = getSelfTypeInContext()) {
10291032
return !contextTy->hasReferenceSemantics();
10301033
}

0 commit comments

Comments
 (0)