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
Resolve type aliases before indexing, dereferencing, and field access #709
bugA problem that causes incorrect behavior or crashes.help wantedThe issue requires extra attention or help from others.needs testingIssues that require additional testing or verification.
Semantic validation rejects array indexing, pointer indexing/dereferencing, and struct field access through type aliases. Replacing each alias with its underlying type makes the same operation compile and run successfully. This breaks the transparent-alias behavior described in #166.
The IndexAccess, Deref, and FieldAccess paths in front/parser/src/verification.rs inspect types without consistently resolving aliases.
Reproduction
Save as repro.wave:
type Values = array<i32, 2>;
fun main() -> i32 {
var values: Values = [10, 20];
return values[1] - 20;
}
Tested at 01955d715dda275de993948037091140bb859174 on Fedora Linux 43, x86_64, with LLVM 21.1.8, at both -O0 and -O2.
Expected: both commands compile and exit 0. Actual: both builds exit 1 with:
error[E3001]: semantic validation failed: index access requires an array or pointer, found `Values`
The same checks reject p[0] and deref p for type IntPtr = ptr<i32>, and p.value for an alias of a struct containing that field. Direct underlying-type controls pass at both optimization levels.
Completion criteria
Resolve aliases consistently before validating these access operations.
Cover direct, chained, and imported aliases of arrays, pointers, and structs in reads and writes.
Add frontend and O0/O2 runtime regressions that behave identically to the underlying types.
Preserve diagnostics for genuinely invalid indexing, dereferencing, and field access.
changed the title [-][Bug]: Resolve type aliases before indexing, dereferencing, and field access[/-][+]Resolve type aliases before indexing, dereferencing, and field access[/+]on Sep 24, 2026
bugA problem that causes incorrect behavior or crashes.help wantedThe issue requires extra attention or help from others.needs testingIssues that require additional testing or verification.
Activity
[-][Bug]: Resolve type aliases before indexing, dereferencing, and field access[/-][+]Resolve type aliases before indexing, dereferencing, and field access[/+]Fix frontend contracts and native regression tests (#723)