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 number/integer stuff #4095

Merged
merged 4 commits into from
Aug 14, 2021

Conversation

TPGamesNL
Copy link
Member

@TPGamesNL TPGamesNL commented Jun 21, 2021

Description

Improve integer support by making expressions that will always return an integer, reflect that in their return type.
Test code:

function test(i: integer):
	broadcast "i %{_i}%"

command /test:
	trigger:
		test(size of all players)
		loop 2 times:
			test(loop-integer)
			test(loop-number)
			test(loop-value)

Target Minecraft Versions: any
Requirements: none
Related Issues: #1602, #2326

@TPGamesNL TPGamesNL added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jun 21, 2021
Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

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

Looks good to me! The idea here of using longs is to prevent overflow, right?

@TPGamesNL
Copy link
Member Author

Looks good to me! The idea here of using longs is to prevent overflow, right?

I use longs because those are what Skript uses for integers:

Classes.registerClass(new ClassInfo<>(Long.class, "long")
.user("int(eger)?s?")

@TPGamesNL TPGamesNL merged commit 1abd53b into SkriptLang:master Aug 14, 2021
@TPGamesNL TPGamesNL deleted the fix/number-integer-stuff branch August 14, 2021 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants