Returns normally when isWellFormedString(str) would return true. Throws a diagnostic error when isWellFormedString(str) would return false.