summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ast-type.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-11-23 16:02:56 -0800
committerGitHub <noreply@github.com>2022-11-23 16:02:56 -0800
commit4ad0470025da4e808c46023f9a2525febcf973a2 (patch)
tree8fcb1c84121ddf40c50ca58b5de867da0da435ee /source/slang/slang-ast-type.cpp
parent97cb4851eed7a43f10196971b08d3d311386ce9f (diff)
Fix issues around dynamic generic function and autodiff. (#2528)
* Fix issues around dynamic generic function and autodiff. * Fix return type issue. * Fix type unification for generic `inout` parameter. * Fix. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ast-type.cpp')
-rw-r--r--source/slang/slang-ast-type.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp
index 76623d01c..3fcc762ec 100644
--- a/source/slang/slang-ast-type.cpp
+++ b/source/slang/slang-ast-type.cpp
@@ -1178,5 +1178,14 @@ Val* ModifiedType::_substituteImplOverride(ASTBuilder* astBuilder, SubstitutionS
return substType;
}
+Type* removeParamDirType(Type* type)
+{
+ for (auto paramDirType = as<ParamDirectionType>(type); paramDirType;)
+ {
+ type = paramDirType->getValueType();
+ paramDirType = as<ParamDirectionType>(type);
+ }
+ return type;
+}
} // namespace Slang