Add a test for #6976

Closes #6976
Better error message when using vectors in statics

Closes #10487