definite assignment analysis for let (#21024)

* draft for let daa

* patch

* fixes bugs

* errors for global let variable reassignments

* checkpoint

* out param accepts let

* add more tests

* add documentation

* merge tests
This commit is contained in:
ringabout 2022-12-06 17:19:12 +08:00 • committed by GitHub
commit b2c7019006
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 144 additions and 30 deletions

View file

@ -0,0 +1,12 @@
discard """
errormsg: "type mismatch: got <string>"
"""
{.experimental: "strictDefs".}
proc foo(x: var string) =
echo x
proc bar() =
let x: string
foo(x)