[pattern matcher] apply field type early to avoid carrying a mapping function around
[pattern matcher] collect parent class fields so they can be matched against (closes #3507)