diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-07-12 13:48:20 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-07-12 13:48:20 -0700 |
| commit | d43ee03c6101ce76331135cebdc57711cb3a2020 (patch) | |
| tree | f83cadbeeb318fb43a4c533214ffa6b833703072 /source/slang/check.cpp | |
| parent | aca34e771d0ad76d396415e45c5f3cbf294709c9 (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/slang/check.cpp')
| -rw-r--r-- | source/slang/check.cpp | 6 |
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); } |
