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 /docs | |
| 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 'docs')
| -rw-r--r-- | docs/user-guide/06-interfaces-generics.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/user-guide/06-interfaces-generics.md b/docs/user-guide/06-interfaces-generics.md index 30efbada1..b7fca069e 100644 --- a/docs/user-guide/06-interfaces-generics.md +++ b/docs/user-guide/06-interfaces-generics.md @@ -1026,12 +1026,12 @@ void printNumbers<each T>(expand each T args) where T == int void compute<each T>(expand each T args) where T == int { // Maps every element in `args` to `elementValue + 1`, and forwards the - // new values as arguments to `printNumber`. - printNumber(expand (each args) + 1); + // new values as arguments to `printNumbers`. + printNumbers(expand (each args) + 1); // The above statement is equivalent to: // ``` - // printNumber(args[0] + 1, args[1] + 1, ..., args[n-1] + 1); + // printNumbers(args[0] + 1, args[1] + 1, ..., args[n-1] + 1); // ``` } void test() |
