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
null.foo() should be allowed in the snippet below:
extends fun foo(self: Int?): Bool {
if (self == null) { return false }
else { return self!! == 42 }
}
contract Test {
get fun test(): Bool {
return null.foo();
}
}
Now I get the following compilation error message:
Tact compilation failed
Error: test-null.tact:8:16: Invalid type "<null>" for function call
Line 8, col 16:
7 | get fun test(): Bool {
> 8 | return null.foo();
^~~~~~~~~~
9 | }
The text was updated successfully, but these errors were encountered:
@anton-trunov suppose there are two functions: foo(self: Int?) and foo(self: Bool?) and you try to call null.foo(). How should compiler decide which one of these to call?
null.foo()
should be allowed in the snippet below:Now I get the following compilation error message:
The text was updated successfully, but these errors were encountered: