This requires extending the ->optkey type constructor to support rest
arguments, and fixing the keyword function type generation code.
Testing is still limited because there's no parsing for such types.
That will be handled in a later commit.
(cherry picked from commit 3fd9df03f7)