Fix generated code to allow setting matchers of a supertype of the
property type.
Adapt generator to handle complex property types appropriately.