Sema: ensure resolveTypeFields is called for optional and error union types

We call `sema.resolveTypeFields` in order to get the fields of structs
and unions inserted into their data structures. If it isn't called, it
can happen that the fields of a type is queried before those fields are
inserted into (for instance) `Module.Union.fields`, which would result in
a wrong 'no field named' error.

Fixes: #12486
3fa5415253martinhath committed on 8/26/2022, 8:37:17 AM· committed by GitHubparentbcaa9df
3 files changedLine totals unavailable