Stop ICE when referring to foreign static values in statics and consts

(I am new to Git and Github so I'm really sorry if I messed up somewhere)