You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A) ✅ Spring.ShareResources(teamID, "metal", nil) is correctly rejected (3rd arg is amount of resource, in this case metal, so has to be a number).
B) ✅ Spring.ShareResources(teamID, "units") works. It shares whatever is selected - whether this is good behaviour is not in the scope of this ticket.
C) ❔ Spring.ShareResources(teamID, "units", 123) is accepted and behaves the same as not passing any arg at all, even though the 3rd arg is meaningless. This is just a piece of information for context. I am not specifying either way whether this should be rejected.
D) ❌ Spring.ShareResources(teamID, "units", nil) is rejected. The request is to make an explicit nil accepted.
The use case is that I want to wrap the function:
localoriginalShareResources=Spring.ShareResourcesfunctionSpring.ShareResources(teamID, resourceType, amount)
-- some logic here...originalShareResources(teamID, resourceType, amount) -- then forward the original argsend
but doing it like this turns an original working 2-arg call (3rd arg and further are "none" in C parlance), like case B above, into a 3-arg call with the 3rd arg equal to nil, like case D.
This is a general issue where passing a bunch of extra nils at the end of any function should not break anything, but figuring out whether anything else is broken this way is outside of the scope of this ticket.
The text was updated successfully, but these errors were encountered:
Spring.ShareResources(teamID, "metal", nil)
is correctly rejected (3rd arg is amount of resource, in this case metal, so has to be a number).Spring.ShareResources(teamID, "units")
works. It shares whatever is selected - whether this is good behaviour is not in the scope of this ticket.Spring.ShareResources(teamID, "units", 123)
is accepted and behaves the same as not passing any arg at all, even though the 3rd arg is meaningless. This is just a piece of information for context. I am not specifying either way whether this should be rejected.Spring.ShareResources(teamID, "units", nil)
is rejected. The request is to make an explicitnil
accepted.The use case is that I want to wrap the function:
but doing it like this turns an original working 2-arg call (3rd arg and further are "none" in C parlance), like case B above, into a 3-arg call with the 3rd arg equal to
nil
, like case D.This is a general issue where passing a bunch of extra
nil
s at the end of any function should not break anything, but figuring out whether anything else is broken this way is outside of the scope of this ticket.The text was updated successfully, but these errors were encountered: