Detect traits being used as structs in check_expr_with_unifier

Not sure if this is addressing the root cause or just patching up a symptom. Also not sure if I should be adding a diagnostic code for this.

Fixes #16750
Fixes #15812