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 (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 5418E1960007 for ; Fri, 19 Jun 2015 00:25:28 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 39C92B5D8C6 for ; Fri, 19 Jun 2015 00:48:14 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 2DE6497A826 for ; Fri, 19 Jun 2015 00:48:17 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Authentication-Results: funfun.nagaokaut.ac.jp (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=sendgrid.me Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wdhakYMa9FbN for ; Fri, 19 Jun 2015 00:48:17 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 0BB5597A820 for ; Fri, 19 Jun 2015 00:48:17 +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 F1CDF952439 for ; Fri, 19 Jun 2015 00:48:13 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 6507B12046B; Fri, 19 Jun 2015 00:48:15 +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 446DB12043B for ; Fri, 19 Jun 2015 00:48:10 +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=d/A7WdN3e2voTFe4N0BuNrlMQEY=; b=mzN10ntd1gWufO1zwF Vty0Caj4cOMq4JpeHmAGjkQ7yMLhi8nC1SsRTo6r9VPn3yYAsRQGkEavoQJTlglP iMvkBT9WdQD/hMkOj4+BgiBbxGLsHPGIH/7oMfI/J8szwakPqq08EcrFrvuvJyhD MAimC6T6b7UYNWhVD0AEHwZiU= Received: by filter0490p1mdw1.sendgrid.net with SMTP id filter0490p1mdw1.12342.5582E835A 2015-06-18 15:48:05.2136487 +0000 UTC Received: from herokuapp.com (ec2-54-159-84-57.compute-1.amazonaws.com [54.159.84.57]) by ismtpd-036 (SG) with ESMTP id 14e075b0f8f.2853.35b054 for ; Thu, 18 Jun 2015 15:48:05 +0000 (UTC) Date: Thu, 18 Jun 2015 15:48:05 +0000 From: andrew.kozin@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 44206 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11283 X-Redmine-Issue-Author: nepalez X-Redmine-Sender: nepalez 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS6lvz29Tq/erhowk8OVYeNxzj3JmxCJFR47QZ jpvy1SzwhuwLWtPoPcW5SI0QFrtRao3qikElyCVh66ZHsrHcqpSmP0oAtsyJZvuzGPzgjOo28geRYP OiXHK/uUFWxvJe2HSZ9iS5u6KEp9owt6/uF2 X-ML-Name: ruby-core X-Mail-Count: 69658 Subject: [ruby-core:69658] [Ruby trunk - Bug #11283] Block assigned implicitly 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: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11283 has been updated by Andrew Kozin. Description updated ---------------------------------------- Bug #11283: Block assigned implicitly https://bugs.ruby-lang.org/issues/11283#change-53018 * Author: Andrew Kozin * Status: Open * Priority: Normal * Assignee: * ruby -v: 1.9.3, 2.0, 2.1, 2.2, ruby-head * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- That is how it works: module Test def self.build(&block) klass = Class.new(Object) klass.__send__(:define_method, :foo) klass.__send__(:define_method, :bar) klass end end Tested = Test.build { :foo } # warning: tried to create Proc object without a block # => Tested Tested.new.foo # => :foo Tested.new.bar # => :foo The block is assigned to all invocations of `__send__` implicitly, while it wasn't asked to. The behaviour is tested under MRI 1.9.3, 2.0, 2.1, 2.2, ruby-head. Exceptions are raised by Rbx and Jruby interpreters. For the context look at this thread https://github.com/mbj/mutant/issues/356 -- https://bugs.ruby-lang.org/