Use an intermediate representation to reinterpret the value in Target::paintAsType
Merge pull request #3726 from ibuclaw/paintnounion

Use an intermediate representation to reinterpret the value in Target::paintAsType