Skip to content

Commit

Permalink
Fix terminal execution checking of exhaustive enums
Browse files Browse the repository at this point in the history
  • Loading branch information
aardappel committed Dec 4, 2024
1 parent d5df797 commit 4e36b53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dev/src/lobster/small_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ template<typename T, int N> class small_vector {
return cap == N ? elems : buf;
}

bool empty() {
bool empty() const {
return len == 0;
}

Expand Down
2 changes: 1 addition & 1 deletion dev/src/lobster/typecheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -3875,7 +3875,7 @@ bool Return::Terminal(TypeChecker &) const {
}

bool Block::Terminal(TypeChecker &tc) const {
return children.back()->Terminal(tc);
return children.empty() || children.back()->Terminal(tc);
}

bool IfElse::Terminal(TypeChecker &tc) const {
Expand Down

0 comments on commit 4e36b53

Please sign in to comment.