You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Conditional rest parameter type cause args to be undefined #484
// Minimal reproduction for Perry compiler bug:// Conditional rest parameter type `T extends void ? [] | [void] : [T]`// causes runtime TypeError: Cannot read properties of undefined (reading 'length')classBuilder{with<T>(id: number, ...args: Textendsvoid ? []|[void] : [T]): this {console.log("args.length:",args.length);returnthis;}}constb=newBuilder();b.with(1);console.log("Done");
Command you ran:
perry test.ts && ./test
Environment
Perry version: 0.5.581
Host OS: ArchLinux
Target: native
Rust toolchain (if building from source): rustc 1.95.0 (59807616e 2026-04-14)
Installed via: from source
Diagnostic output
Perry Doctor
Environment Checks
──────────────────
✓ perry version: 0.5.581
✓ update status: up to date
✓ clang (LLVM codegen): clang version 22.1.3
✓ system linker (cc): cc (GCC) 16.1.1 20260430
✓ runtime library: /home/codehz/Projects/perry/target/release/libperry_runtime.a
⚠ project config (perry.toml): not found - run: perry init
All critical checks passed with some warnings.
Anything else
If change the rest parameter to any[] it will works
Activity