Backed out a commit by Fraser where he has a ternary operator return different types, which is illegal and breaks my build :)