contract Example {
init() {
self.nonExistentField = 42;
}
}
Its compilation fails (as expected), but produces a weird error involving type coersion of JS/TS somewhere (not expected):
Error: example.tact:3:9: Type "Example" does not have a field named "[object Object]"
Line 3, col 9:
2 | init() {
> 3 | self.nonExistentField = 42;
^~~~~~~~~~~~~~~~~~~~~
4 | }
at throwCompilationError (node_modules/@tact-lang/compiler/dist/errors.js:64:11)
at resolveFieldAccess (node_modules/@tact-lang/compiler/dist/types/resolveExpression.js:252:48)
at resolveExpression (node_modules/@tact-lang/compiler/dist/types/resolveExpression.js:487:16)
at processStatements (node_modules/@tact-lang/compiler/dist/types/resolveStatements.js:153:61)
at processFunctionBody (node_modules/@tact-lang/compiler/dist/types/resolveStatements.js:391:17)
at resolveStatements (node_modules/@tact-lang/compiler/dist/types/resolveStatements.js:446:19)
at precompile (node_modules/@tact-lang/compiler/dist/pipeline/precompile.js:24:53)
at build (node_modules/@tact-lang/compiler/dist/pipeline/build.js:58:43)
at Object.run (node_modules/@tact-lang/compiler/dist/node.js:84:47)
Consider the following snippet:
Its compilation fails (as expected), but produces a weird error involving type coersion of JS/TS somewhere (not expected):