Decoding a dictionary with a custom type (not String) as key

I see. Thanks for the answer.

Is it unreasonable to expect the second piece of code to work as I mentioned?