diff options
| author | Yong He <yonghe@outlook.com> | 2025-10-16 11:23:13 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-16 18:23:13 +0000 |
| commit | bedc3421c9e1e0837fa69e30396a27a60f0fee53 (patch) | |
| tree | 4ac8a8f5a4fbfc5f601cd60f82e73e29664123ba /source/slang/slang-ast-type.cpp | |
| parent | d8b732d7ba6d31a724cb18dc93f60d8bcc522c19 (diff) | |
Fix use of variadic generics with [Differentiable]. (#8736)
There was a bug that causes the compiler failing to treat a `no_diff
TypePack` as a type pack, and thus diagnose an error when resolving the
following call.
The fix is to unwrap any ModifiedType wrappers in `IsTypePack()` check.
Diffstat (limited to 'source/slang/slang-ast-type.cpp')
| -rw-r--r-- | source/slang/slang-ast-type.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp index e3f75cb2f..bfa347df3 100644 --- a/source/slang/slang-ast-type.cpp +++ b/source/slang/slang-ast-type.cpp @@ -4,6 +4,7 @@ #include "slang-ast-builder.h" #include "slang-ast-dispatch.h" #include "slang-ast-modifier.h" +#include "slang-check.h" #include "slang-syntax.h" #include <assert.h> @@ -13,6 +14,7 @@ namespace Slang bool isAbstractTypePack(Type* type) { + type = unwrapModifiedType(type); if (as<ExpandType>(type)) return true; if (isDeclRefTypeOf<GenericTypePackParamDecl>(type)) @@ -22,6 +24,7 @@ bool isAbstractTypePack(Type* type) bool isTypePack(Type* type) { + type = unwrapModifiedType(type); if (as<ConcreteTypePack>(type)) return true; return isAbstractTypePack(type); |
