debuginfo: Implement discriminator type metadata re-use.