summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index b76fe0003..5ca0af1c9 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -581,6 +581,12 @@ namespace Slang
SourceLoc loc,
Expr* originalExpr)
{
+ if (!item.declRef)
+ {
+ originalExpr->type = QualType(m_astBuilder->getErrorType());
+ return originalExpr;
+ }
+
// We could be referencing a decl that will be synthesized. If so create a placeholder
// and return a DeclRefExpr to it.
if (auto lookupResultExpr = maybeUseSynthesizedDeclForLookupResult(item, originalExpr))