DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.36k stars 29 forks source link

`for own` doesn't work inside `comptime` #1185

Closed bbrk24 closed 5 months ago

bbrk24 commented 5 months ago

Minimal reproducer:

console.log comptime
  for own x in { foo: 1 }
    ;
edemaine commented 5 months ago

Ah, good catch. This is a general issue with all "helpers" in generated code. I think we could fix this before solving the general "copy things out of scope into comptime block" problem: we can look for refs that match refs in the helpers block and copy them.