# \[ruby-trunk - Bug #10653\] \[Open\] do-end block in ternary operator is syntax error

**URL:** <https://www.ruby-forum.com/t/ruby-trunk-bug-10653-open-do-end-block-in-ternary-operator-is-syntax-error/233585>\
**Category:** Development\
**Created:** [December 26, 2014, 4:02am UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-10653-open-do-end-block-in-ternary-operator-is-syntax-error/233585 "2014-12-26T04:02:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [December 26, 2014, 4:02am UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-10653-open-do-end-block-in-ternary-operator-is-syntax-error/233585/1 "2014-12-26T04:02:44Z")

</div>

Issue #10653 has been reported by Shinta Koyanagi.

* * *

Bug #10653: do-end block in ternary operator is syntax error

> **[Bug #10653: do-end block in ternary operator is syntax error - Ruby master -...](https://bugs.ruby-lang.org/issues/10653)**
>
> Redmine

- Author: Shinta Koyanagi
- Status: Open
- Priority: Normal
- Assignee: Yukihiro M.
- Category: syntax
- Target version:
- ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86\_64-darwin14]
- Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN

* * *

- For example

```auto
ruby -v -e 'true ? 1.tap do |n| p n end : 0'

```

- Result by 2.1.5

```auto
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin14.0]
1

```

- Result by 2.2.0

```auto
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
-e:1: syntax error, unexpected keyword_do_cond, expecting ':'
true ? 1.tap do |n| p n end : 0
               ^
-e:1: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' 
or '('
true ? 1.tap do |n| p n end : 0
                       ^

```
