From d43ee03c6101ce76331135cebdc57711cb3a2020 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Wed, 12 Jul 2017 13:48:20 -0700 Subject: 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. --- source/slang/check.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/slang/check.cpp') 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()) + { + // Don't report an l-value issue on an errorneous expression + } + else if (!isRewriteMode()) { getSink()->diagnose(expr, Diagnostics::assignNonLValue); } -- cgit v1.2.3