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 parsing not always converting expressions #3774

Merged
merged 3 commits into from
Mar 22, 2021

Conversation

TPGamesNL
Copy link
Member

@TPGamesNL TPGamesNL commented Feb 25, 2021

Description

The parser returned a expression that was parsed, even if the return type didn't match, under the following conditions:

  1. The syntax it was used in supported multiple types for that expression
  2. The return type of the parsed expression was Object

The comment on the line responsible for this behaviour was:

Expression will have to deal with it runtime

But this is a bad idea, as a syntax element could receive an expression it wasn't made for.


Target Minecraft Versions: any
Requirements: none
Related Issues: #3695, #3782

@TPGamesNL TPGamesNL added 2.5 bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. labels Feb 25, 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.

This looks fine to me (as long as anything won't be broken). I used this test (similar to the one in the linked issue):

on right click:
	set {_x} to chest inventory named "GUI"
	set slot 0 of {_x} to stone named "Item Test"
	open {_x} to player
	wait 5 tick
	set {_it::*} to all items out of current inventory
	loop {_it::*}:
		send "%name of loop-value%"
		send "%item amount of loop-value%"

@Whimsyturtle Whimsyturtle merged commit f1f9904 into SkriptLang:master Mar 22, 2021
@TPGamesNL TPGamesNL deleted the fix/expr-item-amount-cce branch March 22, 2021 10:14
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.

4 participants