summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-07-12 13:48:20 -0700
committerTim Foley <tfoley@nvidia.com>2017-07-12 13:48:20 -0700
commitd43ee03c6101ce76331135cebdc57711cb3a2020 (patch)
treef83cadbeeb318fb43a4c533214ffa6b833703072 /source
parentaca34e771d0ad76d396415e45c5f3cbf294709c9 (diff)
Don't report error on assigning to an erroneous expression
An expression with error type may still fail the l-value check, but we don't want to emit an error in that case.
Diffstat (limited to 'source')
-rw-r--r--source/slang/check.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/slang/check.cpp b/source/slang/check.cpp
index b87f7c6bc..b175b7f86 100644
--- a/source/slang/check.cpp
+++ b/source/slang/check.cpp
@@ -2540,7 +2540,11 @@ namespace Slang
if (!type.IsLeftValue)
{
- if (!isRewriteMode())
+ if (type->As<ErrorType>())
+ {
+ // Don't report an l-value issue on an errorneous expression
+ }
+ else if (!isRewriteMode())
{
getSink()->diagnose(expr, Diagnostics::assignNonLValue);
}