Skip to content

Commit

Permalink
fix: Generated aliases was overflowing in calling function
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsheep committed Jul 20, 2020
1 parent e5789c6 commit 14c0422
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/grammar/Visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3444,6 +3444,13 @@ class Visitor

Alias *generateGenericAlias(Types::GenericAlias *generic, const std::vector<Type *> &generics)
{
Position position;

if (this->scopes.top()->in_function())
{
position = Position::save(this->scopes.top()->builder());
}

auto scope = Scope::create(generic->scope);
this->scopes.push(scope);

Expand All @@ -3459,6 +3466,8 @@ class Visitor

generic->children.push_back(Types::GenericAliasChild(generics, alias));

position.load(this->scopes.top()->builder());

return alias;
}

Expand Down

0 comments on commit 14c0422

Please sign in to comment.