Possible fix for issue #594

DMD always uses the value type for name mangling of templates. If the type is defined in the template and the value type differs (e.g. parameter type is `long` and constant 4 (`int`) is used) then LDC got confused about this fact. As a result, sometimes the parameter type and sometime the value type was used.

This commit changes the name mangling to use the parameter type, if possible. This is incompatible with
DMD but solves the issue. The related DMD error is https://issues.dlang.org/show_bug.cgi?id=12720