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

function/stdlib: SetSymmetricDifferenceFunc is actually SetSubtractFunc #27

Open
apparentlymart opened this issue Nov 12, 2019 · 1 comment
Labels
bug functions/stdlib The "standard library" functions

Comments

@apparentlymart
Copy link
Collaborator

Due to what I assume was a copy-paste error, the SetSymmetricDifferenceFunc seems to actually be implementing SetSubtractFunc due to calling the wrong method on the underlying set implementation.

var SetSymmetricDifferenceFunc = function.New(&function.Spec{
Params: []function.Parameter{
{
Name: "first_set",
Type: cty.Set(cty.DynamicPseudoType),
AllowDynamicType: true,
},
},
VarParam: &function.Parameter{
Name: "other_sets",
Type: cty.Set(cty.DynamicPseudoType),
AllowDynamicType: true,
},
Type: setOperationReturnType,
Impl: setOperationImpl(func(s1, s2 cty.ValueSet) cty.ValueSet {
return s1.Subtract(s2)
}),
})

There are also no unit tests for either SetSubtractFunc or SetSymmetricDifferenceFunc.

@nikpivkin
Copy link

@apparentlymart That seems to have been fixed already. 88189cd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug functions/stdlib The "standard library" functions
Projects
None yet
Development

No branches or pull requests

2 participants