semantic: Correctly retrieve runtime constant from type refs.