tact
tact copied to clipboard
Expand `reduceBool` and add `reduceSlice`
resolves #195
I didn't cover that with new tests yet, going to do it soon
Current implementation doesn't actually work and throws errors on compiling new test cases. I'll investigate the problem and try to fix it.
The issue here is that constant evaluation is performed on a non-typechecked AST. So when you call getExpType to dispatch on the type of == / != operators, there is no actual type information. The proper fix here would be to refactor the compiler to perform constant evaluation after typechecking (and to actually do this refactoring we need a new type describing typed ASTs).
Looks like this PR should be closed now? Because the architecture of the constant evaluator has changed a lot in #432. Of course, we can still improve a lot of things in the constant evaluator, adding support for slices would be especially nice.
yes, right