Only create scope in LetDeclaration if it is a function
This commit is contained in:
parent
d81e92231f
commit
35bcf38eb3
1 changed files with 6 additions and 3 deletions
|
@ -1995,11 +1995,14 @@ namespace bolt {
|
||||||
Body(Body) {}
|
Body(Body) {}
|
||||||
|
|
||||||
inline Scope* getScope() override {
|
inline Scope* getScope() override {
|
||||||
|
if (isFunction()) {
|
||||||
if (TheScope == nullptr) {
|
if (TheScope == nullptr) {
|
||||||
TheScope = new Scope(this);
|
TheScope = new Scope(this);
|
||||||
}
|
}
|
||||||
return TheScope;
|
return TheScope;
|
||||||
}
|
}
|
||||||
|
return Parent->getScope();
|
||||||
|
}
|
||||||
|
|
||||||
bool isInstance() const noexcept {
|
bool isInstance() const noexcept {
|
||||||
return Parent->getKind() == NodeKind::InstanceDeclaration;
|
return Parent->getKind() == NodeKind::InstanceDeclaration;
|
||||||
|
|
Loading…
Reference in a new issue