From b7d318f48db2cb83a41d665f1727ae93fc555124 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 28 Sep 2023 18:07:40 -0700 Subject: Support `constref` parameters passing. (#3249) * Support `constref` parameters passing. * Fix. * Fix. * Add test and diagnostic on mix use of __constref and no_diff. * check for [constref] on differentiable member method. --------- Co-authored-by: Yong He --- source/slang/slang-check-expr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-check-expr.cpp') diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp index 5ea897448..abdd89b01 100644 --- a/source/slang/slang-check-expr.cpp +++ b/source/slang/slang-check-expr.cpp @@ -214,11 +214,11 @@ namespace Slang { auto exprType = expr->type.type; - if (auto refType = as(exprType)) + if (auto refType = as(exprType)) { auto openRef = m_astBuilder->create(); openRef->innerExpr = expr; - openRef->type.isLeftValue = true; + openRef->type.isLeftValue = (as(exprType) != nullptr); openRef->type.type = refType->getValueType(); return openRef; } -- cgit v1.2.3