summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-stmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-stmt.cpp')
-rw-r--r--source/slang/slang-check-stmt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/slang/slang-check-stmt.cpp b/source/slang/slang-check-stmt.cpp
index bc89dc94e..a61f48af6 100644
--- a/source/slang/slang-check-stmt.cpp
+++ b/source/slang/slang-check-stmt.cpp
@@ -151,6 +151,10 @@ namespace Slang
Expr* SemanticsVisitor::checkPredicateExpr(Expr* expr)
{
+ if (as<AssignExpr>(expr))
+ {
+ getSink()->diagnose(expr, Diagnostics::assignmentInPredicateExpr);
+ }
Expr* e = expr;
e = CheckTerm(e);
e = coerce(m_astBuilder->getBoolType(), e);