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

Remove validation restriction of data parameter to getAll being only a constant or variable (to enable FunctionExpression) #686

Open
aormerod-gs opened this issue Apr 14, 2023 · 0 comments

Comments

@aormerod-gs
Copy link
Contributor

return isDateConstant(coreInstance) || isVariableExpressionReturningADate(coreInstance);

Currently the method checks that the business date is a constant or a VariableExpression, expecting use cases of

MyClass.all(%2015-01-01)

or

let businessDate = today(); 
MyClass.all($businessDate );

However it gives compiler usage like

let businessDate = today(); 
MyClass.all($businessDate )
     ->concatenate(MyClass.all($businessDate->adjust(-1, DurationUnit.DAYS));

due to the parameter being a FunctionExpression.

Although people can still create an equivalent query via:

let businessDate = today(); 
MyClass.all($businessDate )
     ->concatenate({d:Date[1]|MyClass.all($d)}->eval($businessDate->adjust(-1, DurationUnit.DAYS));

and the compiler won't complain (but it's more complicated to write / less clear)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant