Problem with ternary operator and break

I ran into a problem where the following works fine…


if (nextJewel.gemType == jewel.gemType){
     len++;
}else{
     break;
}

but the following…


(nextJewel.gemType == jewel.gemType) ? len++ : break;

produces a 1084: Syntax error: expecting identifier before break.

I’m not sure why. It’s a minor problem, but if someone knows how to fix it or why it does that, I’d appreciate it.

Thanks.