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

Sending empty message throws at FunC compilation #74

Closed
Tarnadas opened this issue Oct 19, 2023 · 2 comments · Fixed by #380
Closed

Sending empty message throws at FunC compilation #74

Tarnadas opened this issue Oct 19, 2023 · 2 comments · Fixed by #380
Assignees
Labels
bug Something isn't working or isn't right typechecker
Milestone

Comments

@Tarnadas
Copy link

Hey,

if I try to send an empty message the FunC compiler throws a cryptic error message:

Func compilation error:...:184:14: error: previous function return type tuple cannot be unified with return statement expression type (): cannot unify type () with tuple

Example:

message MyMessage {
}

contract MyContract {
    receive("send") {
        send(SendParameters {
            to: context().sender, 
            value: 0, 
            bounce: false,
            mode: SendIgnoreErrors,
            body: MyMessage {}.toCell()
        });
    }
}

After investigating the Tact compiler output it was clear that the error was caused by the empty message.

@imsk17
Copy link

imsk17 commented Mar 27, 2024

Hi, I am also facing a similar error and i have checked that there are no empty messages.

@anton-trunov
Copy link
Member

@imsk17 Could you please provide your Tact source code and the exact error message you see?

@anton-trunov anton-trunov added this to the v1.4.0 milestone May 1, 2024
@anton-trunov anton-trunov modified the milestones: v1.4.0, v1.3.1 May 17, 2024
@anton-trunov anton-trunov added the bug Something isn't working or isn't right label May 17, 2024
Srg-12 added a commit to Srg-12/tact that referenced this issue Jul 22, 2024
Edited:
Line tact-lang#74 From:
 } else if (code == 45 || code == 43) { // - or +
To:
 } else if (code == 45 && code == 43) { // - or +

Line tact-lang#76 From:
} else if (code == 95 || code == 47) { // _ or /
} else if (code == 95 && code == 47) { // _ or /
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

Successfully merging a pull request may close this issue.

4 participants