Fix crash on go-to-def on union method

Fixes #1439.