Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Strata/DL/Imperative/CmdType.lean
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def Cmd.typeCheck {P C T} [ToFormat P.Ident] [ToFormat P.Ty] [ToFormat (Cmd P)]
else
let (xty, τ) ← TC.preprocess ctx τ xty
let (expr, ety, τ) ← TC.inferType ctx τ c expr
let τ ← TC.unifyTypes τ [(xty, ety)]
let τ ← (TC.unifyTypes τ [(xty, ety)]).mapError fun _ =>
md.toDiagnosticF f!"Variable '{x}' expected type {xty} but \
initialization expression has inferred type {ety}."
let (xty, τ) ← TC.postprocess ctx τ xty
let τ := TC.update τ x xty
let c := Cmd.init x xty (.det expr) md
Expand Down
Loading