Skip to content

refactor: require() now uses exit codes starting from 1024#2315

Closed
Shvandre wants to merge 16 commits intomainfrom
2245-require-should-use-smaller-exit-codes
Closed

refactor: require() now uses exit codes starting from 1024#2315
Shvandre wants to merge 16 commits intomainfrom
2245-require-should-use-smaller-exit-codes

Conversation

@Shvandre
Copy link
Contributor

@Shvandre Shvandre commented Mar 6, 2025

Issue

Closes #2245 .

@verytactical verytactical mentioned this pull request Mar 6, 2025
@Shvandre Shvandre force-pushed the 2245-require-should-use-smaller-exit-codes branch from abe2164 to 6ddbbce Compare March 6, 2025 14:36
@Shvandre Shvandre marked this pull request as ready for review March 6, 2025 14:37
@Shvandre Shvandre requested a review from a team as a code owner March 6, 2025 14:37
@novusnota novusnota changed the title refactor: Require now uses exit codes starting from 1024 refactor(stdlib): require() now uses exit codes starting from 1024 Mar 6, 2025
@novusnota novusnota added this to the v1.6.2 milestone Mar 6, 2025
@novusnota novusnota self-requested a review March 6, 2025 14:40
@anton-trunov anton-trunov changed the title refactor(stdlib): require() now uses exit codes starting from 1024 refactor: require() now uses exit codes starting from 1024 Mar 6, 2025
@Shvandre Shvandre requested review from anton-trunov and i582 March 6, 2025 14:45
Copy link
Contributor

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test demonstrating

require(false, "second");
require(false, "second");

is handled correctly.

@anton-trunov
Copy link
Contributor

One more thought: this PR breaks backwards compatibility with the current behavior of require: require(cond, "error message") in several places will have the same exit code because the string is shared.

@anton-trunov anton-trunov removed this from the v1.6.2 milestone Mar 6, 2025
@novusnota
Copy link
Member

novusnota commented Mar 6, 2025

One more thought: this PR breaks backwards compatibility with the current behavior of require: require(cond, "error message") in several places will have the same exit code because the string is shared.

I think that's reasonable. For posterity though, I'll push the updated docs for require() in a moment since I've almost finished them :)

…om:tact-lang/tact into 2245-require-should-use-smaller-exit-codes
@anton-trunov
Copy link
Contributor

I don't think we need one more source of implicitness in the language, especially the one that breaks backwards compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

require() should use smaller exit codes

4 participants