I created a new player character blueprint and opened it up. Then I created a new function within the player character blueprint and added a local integer variable with a default value of -1. I proceeded to compile and the editor did not freeze, crash or even hiccup. I tried this multiple times, with different numbers too.
Are you having this issue on a specific project? Are you able to reproduce it within a new project? Is your project created from a c++ template or a blueprint template?
I’ve tried it again today, and I can compile without problem. This is pretty strange, I’m sure I wasn’t able to compile blueprint script no matter how many times I restart UE4 editor.