fix Issue 12580 - dup() won't accept void[]
Merge pull request #766 from MartinNowak/fix12580

fix Issue 12580 - dup() won't accept void[]
Add support for dup of non-castable-to-mutable