You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #1652 introduces the ability to execute method calls, but it is now blocked due to the following issue caused by early constant initialization. In the following Tact code:
const A: Int = callIncrement(10);
fun callIncrement(v: Int): Int {
return v.incr(); // Execution fails here because v does not have yet a type registered in CompilerContext
} // and it is required in order to obtain function incr assigned to reference type Int.
extends fun incr(self: Int): Int {
self += 1;
return self;
}
Since constant initialization is carried out before function callIncrement is type-checked, the indicated line causes an internal compiler error because variable v still does not have a registered type in CompilerContext:
Error: [INTERNAL COMPILER ERROR]: Expression 1784 not found
Please report at https://github.com/tact-lang/tact/issues
at throwInternalCompilerError (/home/jesus/tact/tact/src/error/errors.ts:66:11)
at getExpType (/home/jesus/tact/tact/src/types/resolveExpression.ts:37:35)
at Interpreter.interpretMethodCall (/home/jesus/tact/tact/src/optimizer/interpreter.ts:943:41)
at Interpreter.interpretExpression (/home/jesus/tact/tact/src/optimizer/interpreter.ts:851:29)
.....
The same happens if we replace variable v with a number, for example:
fun callIncrement(v: Int): Int {
return 10.incr(); // Execution fails here because 10 does not have yet a type registered in CompilerContext
}
Constant initialization must be moved after typechecking.
The text was updated successfully, but these errors were encountered:
PR #1652 introduces the ability to execute method calls, but it is now blocked due to the following issue caused by early constant initialization. In the following Tact code:
Since constant initialization is carried out before function
callIncrement
is type-checked, the indicated line causes an internal compiler error because variablev
still does not have a registered type inCompilerContext
:The same happens if we replace variable
v
with a number, for example:Constant initialization must be moved after typechecking.
The text was updated successfully, but these errors were encountered: