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
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Vararg aftermarket expression functions raise exceptions inside format strings #13026
Using the MGL_FUNCTION(…) expression function inside an NSExpression or NSPredicate format string raises an exception:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unrecognized expression function MGL_FUNCTION:.'
The workaround is to use the %@ placeholder and set it to the result of passing MGL_FUNCTION into +[NSExpression expressionForFunction:arguments:].
The root cause is that this line only checks for MGL_FUNCTION function name, but NSExpression considers the function name to be MGL_FUNCTION:, with the extra colon, when there are any arguments:
So we need to check for both variants. While we’re at it, we should also add cases for MGL_IF: (not to be confused with mgl_if:, which takes a different set of arguments) and MGL_MATCH::
Once we fix #11720, we’ll end up having to distinguish between mgl_if: when used as a conventional function and mgl_if: when used as an aftermarket function.
Activity
1ec5 commentedon Oct 3, 2018
This complicates the
MGL_FUNCTIONworkaround for #12917 and #12739 to some degree.