Closed byakuren-hijiri closed 3 months ago
Constant declarations should be forbidden for contracts and only allowed for traits
The issue is still present in ac5b87abcaa13183a3fea0a499100b2bff8efdcc
for non-initialized trait constants:
trait bYO___ZJ__g_g {
const x_B_y_H_8: Int;
}
Compilation error:
Error: ../TON-Projects/tact-template/sources/contract.tact:4:5: Abstract function doesn't have abstract modifier
Line 4, col 5:
3 | trait bYO___ZJ__g_g {
> 4 | const x_B_y_H_8: Int;
^~~~~~~~~~~~~~~~~~~~~
5 | }
It is just about an incorrect error message which has a trivial fix.
Error message:
Expected: Something like this, e.g.
Contract constant is not initialized
.When adding such a constant in the
ASTContract
entry directly, compilation fails with an exception here, becauses
isundefined
.