tact icon indicating copy to clipboard operation
tact copied to clipboard

Tact produces FunC code with errors

Open 0kenx opened this issue 1 year ago • 3 comments

Some errors, such as some type errors, are not caught by the Tact-FunC transpiler, but the FunC compiler would report errors on the FunC code generated by Tact.

This is not acceptable, and Tact should always produce error-free FunC code.

0kenx avatar Jan 05 '24 20:01 0kenx

For example

"abc".asSlice().loadUint(8);

gives error: Func compilation error: error: lvalue expected before ~__tact_load_uint

where as

let s: Slice = "abc".asSlice();
s.loadUint(8)

compiles without errors.

0kenx avatar Jan 05 '24 21:01 0kenx

1

tonMaxi avatar Jan 16 '24 10:01 tonMaxi

You are totally right, well-typed Tact code should not provoke any FunC typechecking errors. Will fix the concrete example you provided in Tact v1.3.0 release most likely. Although it's hard to ensure this in general, property-based randomized testing (see issue #133) usually gets good results in terms of hardening compiler implementations against such bugs. It might take several months to build this infrastructure for us, though. In the mean time, I'd really appreciate reporting Tact-FunC bugs like this one.

anton-trunov avatar Feb 16 '24 14:02 anton-trunov