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

Fix the order of the arguments being inputted into result.append in print() from the Type Function Runtime #1676

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

karl-police
Copy link
Contributor

@karl-police karl-police commented Feb 20, 2025

This fixes print from the Type Function Runtime, when you use , inside of print() within a type function.

Currently, in the Type Function Runtime, if you do print(1, 2)

It's going to append \x1 based on the size_t of \t, because it's in the wrong function argument order.

It's not going to use \t instead it creates \x1 because of a copy paste mistake from the original print

result.append has a different function order

image

Currently, it's the wrong order

This is the right way

image

 

Before:
image

After:
image

@karl-police karl-police changed the title Fix type function print append function argument order Fix the order of the arguments being inputted into result.append of print() from the Type Function Runtime Feb 20, 2025
@karl-police
Copy link
Contributor Author

@vegorov-rbx 🙏

@karl-police karl-police changed the title Fix the order of the arguments being inputted into result.append of print() from the Type Function Runtime Fix the order of the arguments being inputted into result.append in print() from the Type Function Runtime Feb 20, 2025
@vegorov-rbx
Copy link
Collaborator

Your PR is missing flag for the change and a unit test.

@vegorov-rbx
Copy link
Collaborator

Flags are easy to add.

You declare a flag at the start of the file with 'Luau' at the start of the name:
LUAU_FASTFLAGVARIABLE(LuauTypeFunPrintFix)
You then have new code under if (FFlag::LuauTypeFunPrintFix).

In the unit test file, you fetch the existing flag using LUAU_FASTFLAG(LuauTypeFunPrintFix) and inside the test case place: ScopedFastFlag luauTypeFunPrintFix{FFlag::LuauTypeFunPrintFix, true};

@karl-police
Copy link
Contributor Author

Flags are easy to add.

You declare a flag at the start of the file with 'Luau' at the start of the name: LUAU_FASTFLAGVARIABLE(LuauTypeFunPrintFix) You then have new code under if (FFlag::LuauTypeFunPrintFix).

In the unit test file, you fetch the existing flag using LUAU_FASTFLAG(LuauTypeFunPrintFix) and inside the test case place: ScopedFastFlag luauTypeFunPrintFix{FFlag::LuauTypeFunPrintFix, true};

Alright, gimme a second.

@karl-police
Copy link
Contributor Author

karl-police commented Feb 20, 2025

or more time, my Github Desktop is exploded and I forgot that I had to add * temporarily to .gitignore

@karl-police
Copy link
Contributor Author

@vegorov-rbx Alright!

image

@karl-police
Copy link
Contributor Author

once it solves this
image

Copy link
Collaborator

@vegorov-rbx vegorov-rbx left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

@vegorov-rbx vegorov-rbx merged commit 29a5198 into luau-lang:master Feb 20, 2025
7 checks passed
@karl-police karl-police deleted the patch-1 branch February 23, 2025 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants