Repository navigation
Closed
Labels
bugSomething isn't workinggood first issueGood for newcomersirIntermediate representation, builders, verification and lowering.needs testingRequires focused correctness or coverage validation.priority mediumNormal development backlog priority.
Description
Current evidence
Audit baseline: master 3ac33ec1, after #11. Source: ir/src/lower_ast/o0.rs:92.
Reproduced: two parameters named x generate two slots, then env.insert replaces the first binding; returning x reads only the second parameter without a diagnostic.
Reproduction
Save as repro.json and run cargo run --features socket-cli -- ir lower repro.json:
{
"globals": [],
"functions": [
{
"name": "f",
"parameters": [
{
"name": "x",
"ty": {
"Int": {
"bits": 32,
"signed": true
}
}
},
{
"name": "x",
"ty": {
"Int": {
"bits": 32,
"signed": true
}
}
}
],
"return_type": {
"Int": {
"bits": 32,
"signed": true
}
},
"body": [
{
"Return": {
"Var": "x"
}
}
]
}
]
}Observed exit status: 0.
module {
target "x86_64-whale-linux"
datalayout { ptr=64, endian=little }
fn @f(x: i32, x: i32) -> i32 {
entry:
%v2: ptr<i32> = alloca i32, align 4
%v3: ptr<i32> = alloca i32, align 4
store i32 %v0, ptr<i32> %v2, align 4
store i32 %v1, ptr<i32> %v3, align 4
%v4: i32 = load i32, ptr<i32> %v3, align 4
ret i32 %v4
}
}
Scope
Difficulty: easy.
Check parameter names before populating the local environment.
Completion criteria
- Duplicate names fail before lowering a body.
- Distinct parameter names retain their correct parameter values.
- The diagnostic names the duplicate parameter and function.
Backlog index: #12. This issue owns only the bounded work described above.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workinggood first issueGood for newcomersirIntermediate representation, builders, verification and lowering.needs testingRequires focused correctness or coverage validation.priority mediumNormal development backlog priority.
Activity