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

[BUG] If statements break return statements and function macros #104

Open
OguzhanUmutlu opened this issue Jul 2, 2024 · 1 comment
Open
Assignees
Labels
Type: Bug Something isn't working

Comments

@OguzhanUmutlu
Copy link
Contributor

Describe the bug

If statements break into new functions inside private folder which breaks both /return and function macros

To Reproduce

Example code that breaks /return:

$a = 1;
function test() {
 if ($a == 1) {
    say "hi";
    return 1;
 }
 return 0;
}

$b = test();

tellraw @a $b.toString();

Example code that breaks function macros:

$x = 1;

function test() {
 if ($x == 1) {
  say "hi";
  $tellraw @a $(a);
 }
}

test({a: 10});

Expected behavior

First one should print out "hi" and "1", but instead it prints out "hi" and "0"

Second one should print out "hi" and "10", but instead it prints out nothing

Desktop

  • OS: Windows 11
  • JMC Version: Latest(1.2.17)
@OguzhanUmutlu OguzhanUmutlu added the Type: Bug Something isn't working label Jul 2, 2024
@Nico314159
Copy link
Contributor

Intended behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants