It seems that parse_anonymous_spec may fail if more than one part (variant, version range, etc.) is given to the function. Added tests to code against to fix the problem in #4144.