Better error on attempt to rebind identifier for static constant.

r? anyone.

Fix #7526.