Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding non-existing function doesn't throws an error #1022

Open
1 task done
imartemy1524 opened this issue Nov 11, 2024 · 0 comments
Open
1 task done

Overriding non-existing function doesn't throws an error #1022

imartemy1524 opened this issue Nov 11, 2024 · 0 comments
Labels
bug Something isn't working or isn't right typechecker
Milestone

Comments

@imartemy1524
Copy link

Are you using the latest released (or pre-released, a.k.a. "next") version?

  • I'm using the latest Tact version

Tact source code

contract Test with Deployable {
    receive("test"){
        self.notDefined();
    }
    // don't thow any error and compile successfully, BUT, this function is not defined anywhere else
    override fun notDefined(){
        self.reply("OK".asComment());
    }
}

Relevant Tact/build system log output

Compiled successfully

What happened?

One tries to override non-existing function and compiler allows one to do it. This can lead to errors in case of typos:

trait Testt{
    virtual fun doThings(){}
    receive("ok"){self.doThings();}
}
contract ContractWithTypo with Deployable, Testt {

    override fun doTThings(){
        self.reply("OK".asComment());
    }
}

One may not recognize the typo, and compiler doesn't warn him about it, which leads to unpredictable behaviour.

What did you expect?

That compiler throws an error

Steps to reproduce

No response

How do you run Tact?

Blueprint

Anything else?

No response

@imartemy1524 imartemy1524 added the bug Something isn't working or isn't right label Nov 11, 2024
@anton-trunov anton-trunov added this to the v1.6.0 milestone Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or isn't right typechecker
Projects
None yet
Development

No branches or pull requests

2 participants