Repository navigation
fix(semantic): make dependent queries safe to re-enter - #1306
Conversation
855312a to
4528244
Compare
2b5e9a1 to
04046ba
Compare
|
We should also change crates\emmylua_code_analysis\src\semantic_model\access.rs |
db7b451 to
ffbfeba
Compare
|
Tested it and it fixes the issue I was having in my project. I'd actually just opened a PR to fix it, but then realized this one already existed, so I closed mine. Hopefully others can review it and it gets merged. Thanks @lewis6991 |
|
Regarding these two failed checks, I think you can download https://pre-commit.com/ or https://github.com/j178/prek. The current project’s |
ffbfeba to
86289d0
Compare
Recursive semantic analysis can depend on query order, report incorrect
type matches, or overflow the stack. Examples include:
- Member lookup can depend on query order:
---@alias Copy<T> {[K in keyof T]: T[K]}
---@alias Node<T> {value: T, copy: Copy<Node<T>>}
- Valid recursive values can be rejected:
---@alias Nested<T> T | Nested<T>[]
---@type Nested<string>
local value = "hello"
- Invalid recursive comparisons can be accepted:
---@alias Link<T> {value: T, next: Link<T>}
---@alias Other<T> {value: T, next: Other<T>}
-- Link<string> must not match Other<integer>.
Share caches and recursion state across file views. Keep unfinished
results temporary and evaluate recursive fields only when needed. Use
work lists and comparison dependencies to handle recursive types. Leave
conditional types unresolved until their result is known.
Allow long finite computations within a shared work budget. Report
exhaustion as type-complexity and continue independent checks.
86289d0 to
fa8cd35
Compare
|
I have pre-commit installed locally. The schema hook only matches |
Recursive semantic analysis can depend on query order, report incorrect type matches, or overflow the stack. Examples include:
Member lookup can depend on query order:
Valid recursive values can be rejected:
Invalid recursive comparisons can be accepted:
Share caches and recursion state across file views. Keep unfinished results temporary and evaluate recursive fields only when needed. Use work lists and comparison dependencies to handle recursive types. Leave conditional types unresolved until their result is known.
Allow long finite computations within a shared work budget. Report exhaustion as type-complexity and continue independent checks.