I definitely support such approach, but it seems to be quite complex. I suppose it would require additional annotation and the types handling feature.

I think it makes sense to create the feature request on Jenkins JIRA, but not to integrate such major changes in this PR