Better error on attempt to rebind identifier for static constant.

Fix #7526.