From: usa@garbagecollect•jp
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:50839] [Ruby master Bug#15906] a=a のような式をもつ条件分岐が意図しない挙動をする
Date: Mon, 26 Aug 2019 14:45:49 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-81023.20190826144549.ef3cbf96d458333e@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-15906.20190607052046@ruby-lang.org
Issue #15906 has been updated by usa (Usaku NAKAMURA).
Backport changed from 2.4: DONTNEED, 2.5: REQUIRED, 2.6: DONE to 2.4: DONTNEED, 2.5: DONE, 2.6: DONE
ruby_2_5 r67757 merged revision(s) a6a26e42b15c46f117f4fce07a2050e9d727355d.
----------------------------------------
Bug #15906: a=a のような式をもつ条件分岐が意図しない挙動をする
https://bugs.ruby-lang.org/issues/15906#change-81023
* Author: nagachika (Tomoyuki Chikanaga)
* Status: Closed
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Target version:
* ruby -v: 2.6.3
* Backport: 2.4: DONTNEED, 2.5: DONE, 2.6: DONE
----------------------------------------
[ruby-list:50781] から一部転載します。
```
下記スクリプトの結果が期待と違います。なぜでしょうか?
a = a は不要ですが、なにもしないことを明示するために書いたものです。
なおOS付属の ruby 2.3.7p456 では期待通りの結果でした。
a = "aaa"
if a == "bbb" || a == "ccc" then
a = a
else
puts "OK"
end
puts "END"
実行結果
END
期待する結果
OK
END
動作環境
MacOS 10.13.6
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin17]
macportsでインストール
```
r63870 から発生するようになっているようです。
--
https://bugs.ruby-lang.org/
prev parent reply other threads:[~2019-08-26 14:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-15906.20190607052046@ruby-lang.org>
2019-06-07 5:20 ` [ruby-dev:50792] [Ruby trunk Bug#15906] a=a のような式をもつ条件分岐が意図しない挙動をする nagachika00
2019-07-28 14:17 ` [ruby-dev:50822] [Ruby master " nagachika00
2019-08-26 14:45 ` usa [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-81023.20190826144549.ef3cbf96d458333e@ruby-lang.org \
--to=ruby-dev@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).