diff options
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
| -rw-r--r-- | source/slang/slang-check-decl.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index deb8c55eb..8e78ff084 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -10204,7 +10204,8 @@ namespace Slang bool isDiffParam = (!param->findModifier<NoDiffModifier>()); if (isDiffParam) { - if (auto pairType = as<DifferentialPairType>(visitor->getDifferentialPairType(param->getType()))) + auto diffPair = visitor->getDifferentialPairType(param->getType()); + if (auto pairType = as<DifferentialPairType>(diffPair)) { arg->type.type = pairType; arg->type.isLeftValue = true; @@ -10225,6 +10226,11 @@ namespace Slang direction = ParameterDirection::kParameterDirection_InOut; } } + else if (auto refPairType = as<DifferentialPtrPairType>(diffPair)) + { + // no need to change direction of ref-pairs. + arg->type.type = refPairType; + } else { isDiffParam = false; |
