This is quite surprising!
In the new version pending release (scheduled for later this week), we get a new feature `static foreach` that will let you loop through the types you want and declare all the functions that way.
When it is released, we'll have to take a second look at this problem.