Report error for non constant vector repeat count

Fix issue #3645