Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept ProjExpr in filters. #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,13 @@ bool TypeChecker::check_filter(const ast::Expr& expr) {
is_mutable = true;
else
return true;
} else if (expr.isa<ast::LiteralExpr>())
} else if (expr.isa<ast::LiteralExpr>()) {
return true;
} else if (auto proj = expr.isa<ast::ProjExpr>()) {
//This needs to be supported to inspect struct and tuple members.
//TODO: Not sure if this check coveres all possible problematic cases.
return check_filter(*proj->expr);
}

error(expr.loc, "unsupported expression in filter");
if (is_logic_or)
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ if (Thorin_HAS_LLVM_SUPPORT)
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

if (NOT TARGET clang)
find_package(Clang REQUIRED CONFIG PATHS ${LLVM_DIR}/../clang NO_DEFAULT_PATH)
find_package(Clang REQUIRED CONFIG PATHS ${LLVM_DIR}/../clang)
endif()

# Compile the helper functions into an object file
Expand Down
Loading