DanielXMoore / Civet

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

`comptime` object literal with ES6 method generates invalid JS #1182

Closed bbrk24 closed 2 months ago

bbrk24 commented 2 months ago

e.g.

x := comptime ({ foo() {} })

Compiles to:

const x = {"foo":foo() {}};
bbrk24 commented 2 months ago

I have an idea on how to fix it; the problem is more general than it seems at first (e.g. x := comptime ({ foo() {} }.foo)). I'll get up a PR later.