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
Parser: a dedent to a level no enclosing block has is accepted, and the line joins the outer block #1781
§29.13 (indentation bodies). A dedent must return to an enclosing indentation level; Python reports "unindent does not match any outer indentation level".
Repro
fn main:
let c = false
if c:
let x = 1
print(f"inner {x}")
print("end")
The if body takes its indentation (12) from its first line; the next line (8) matches no enclosing level (4 for main's body).
Actual
Base stage1 at 76cf0bf: with run prints inner 1 then end — the print at indentation 8 runs with c false, reading x from an arm that never ran. With batch2-ownership's scoping fix (a one-statement body is its own scope) it becomes undefined variable instead, but the parser still accepts the layout silently.
Expected
A parse error at the inconsistent dedent, naming the line and the levels.
Found
In the compiler itself: MirLower.lower_method_call's static-constructor fallback had its let ret_type = ... indented one level deeper than the four lines after it, so those four lines ran on every method call (fixed on batch2-ownership: "MirLower.lower_method_call: the static-constructor fallback runs only when the receiver type is unknown").
Activity
Parser: a block's statements share its column; a line indented to no …
Parser: only a statement that begins its line has an indentation — th…
Parser: a block's statements share its column; a line indented to no …
Parser: only a statement that begins its line has an indentation — th…
Parser: a block's statements share its column; a line indented to no …
Parser: only a statement that begins its line has an indentation — th…