From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (smtp.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 253431B40042 for ; Thu, 29 Dec 2016 03:05:09 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 91F9EB5D868 for ; Thu, 29 Dec 2016 03:34:54 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 8028718CC819 for ; Thu, 29 Dec 2016 03:34:54 +0900 (JST) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id F1FBF1206AA; Thu, 29 Dec 2016 03:34:52 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id 9F21412069A for ; Thu, 29 Dec 2016 03:34:49 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=V38IiBsXv2TxxjWYhmXIUpJozH8=; b=L0xYfluRNWBppHVew3 75IE2IgwFQznNY687dxCXz5jIcBMzd1xeTRA5dLSjODnui6A4g4ZniYLAvYfQBw3 cGfx3VS8nX9+MxfMxPxZd2mLdzKAFFexKfo1phfMCNu3HvW0uLzM3obYvRpBj8Dw DMe4BXCyxmVmua5QkeBToum/Q= Received: by filter1118p1mdw1.sendgrid.net with SMTP id filter1118p1mdw1-24097-586405C5-26 2016-12-28 18:34:45.219784912 +0000 UTC Received: from herokuapp.com (ec2-54-91-117-187.compute-1.amazonaws.com [54.91.117.187]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id 02Y_OUZcRbi2MQyHEE-Mdw for ; Wed, 28 Dec 2016 18:34:45.206 +0000 (UTC) Date: Wed, 28 Dec 2016 18:34:44 +0000 From: kachick1@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 53799 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13083 X-Redmine-Issue-Author: kachick X-Redmine-Sender: kachick X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6AJ4hdO/Ovsr/AUoAUdseM/MJQzwQ7BjHMQO azfb/NDBGhdSDbdE7eSDo9NKtK72JDlzmKcX7DDoEQiUYS+Yg8gx+i5MtumNUF42mf4M57oSSdswcK xJnp/tngf1A5EPUeOxTNKKN7ZEWfhel0TU3grMODT6Ubd15jBfrBFH4ycA== X-ML-Name: ruby-core X-Mail-Count: 78891 Subject: [ruby-core:78891] [Ruby trunk Feature#13083] {String|Symbol}#match{?} with nil returns falsy as Regexp#match{?} X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #13083 has been reported by Kenichi Kamiya. ---------------------------------------- Feature #13083: {String|Symbol}#match{?} with nil returns falsy as Regexp#match{?} https://bugs.ruby-lang.org/issues/13083 * Author: Kenichi Kamiya * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Just for consistency * patch: https://github.com/ruby/ruby/pull/1506 * spec: https://github.com/ruby/spec/pull/380 Currently behaves as ( ruby --version: ruby 2.5.0dev (2016-12-28 trunk 57228) [x86_64-darwin16] ) ~~~ ruby 'string'.__send__(:=~, nil) #=> nil 'string'.match(nil) #=> TypeError: wrong argument type nil (expected Regexp) 'string'.match?(nil) #=> TypeError: wrong argument type nil (expected Regexp) :symbol.__send__(:=~, nil) #=> nil :symbol.match(nil) #=> TypeError: wrong argument type nil (expected Regexp) :symbol.match?(nil) #=> TypeError: wrong argument type nil (expected Regexp) /regex/.__send__(:=~, nil) #=> nil /regex/.match(nil) #=> nil /regex/.match?(nil) #=> false ~~~ Expected to ~~~ruby 'string'.__send__(:=~, nil) #=> nil 'string'.match(nil) #=> nil 'string'.match?(nil) #=> false :symbol.__send__(:=~, nil) #=> nil :symbol.match(nil) #=> nil :symbol.match?(nil) #=> false /regex/.__send__(:=~, nil) #=> nil /regex/.match(nil) #=> nil /regex/.match?(nil) #=> false ~~~ -- https://bugs.ruby-lang.org/