Repository navigation
Description
Problem
Function signatures still lose parameter/type/separator details. For an unsupported type, the diagnostic points at the following token instead of the type. A duplicate parameter loses the duplicate-name message entirely.
The relevant code is front/parser/src/parser/functions.rs. Legacy println! calls are silenced by the parser crate's compatibility macro; the resulting CLI output is valid JSON, but its diagnostic is generic.
Reproduction
Save as repro.wave:
fun f(x: i24) {}
target/release/wavec check repro.wave --error-format=human
target/release/wavec check repro.wave --error-format=jsonTested on master 5002a93a4a233032553aa6c6e3639d88e93c53bf with Fedora Linux 43 amd64 and LLVM 21.1.8, using LLVM_SYS_211_PREFIX=/usr/lib64/llvm21 cargo build --locked --release --jobs 2.
Actual: expected valid function parameters, pointing at ) (column 13), instead of identifying i24 (column 10). fun f() -> i24 { return 1; } reports failed to parse function declaration. fun f(x: i32, x: i32) {} similarly loses the duplicate-name cause. Missing : is also reported generically.
Scope
Use existing ParseError helpers and checked type parsing for function/method parameter and return signatures. Preserve specific missing-separator and duplicate-parameter causes. Keep defaults, generic syntax, method rules, and function-body parsing unchanged.
This is a remaining child of #346. #425 fixed extern type paths in decl.rs; this issue is specifically the ordinary function/method path in functions.rs.
Completion criteria
- Unsupported parameter/return types identify the type start in human and JSON modes.
- Missing
:/,and duplicate names retain their local cause and offending token. - Valid ordinary, generic, defaulted, and method signatures remain accepted.
- Focused parser/CLI regressions cover these paths without relying on suppressed prints.
Activity