From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id CEB0C1F47A for ; Tue, 9 Jul 2024 05:48:01 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=YgrbV6XS; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=jWzbhxgB; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1720504049; bh=YR56gX30NsIQMMz54DtiY1jPTwNHNiTwacghbGT0BWs=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=YgrbV6XSA6ecKqPmBimpaFooOIGs8zcXyA2bcpGc6YFmZT8LGg06OIiDDViKKwX2r 1IDbSfoO9s+s6uhs6h1knfI/IhK3Ia0l3JiE5BZPBT0QSM5LraD2xJXlQnWcUjNA2j /6TRZ2eGrVvmuFJErUxwcUNSdUI3yD8EbCgA6pZo= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 33C5A41409 for ; Tue, 9 Jul 2024 05:47:29 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=jWzbhxgB; dkim-atps=neutral Received: from s.wfbtzhsw.outbound-mail.sendgrid.net (s.wfbtzhsw.outbound-mail.sendgrid.net [159.183.224.105]) by nue.mailmanlists.eu (Postfix) with ESMTPS id AEEE9400B9 for ; Tue, 9 Jul 2024 05:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=Y345Cxscjx7MGfrJHZrHcpID73514oEg2eJjNMWv/kE=; b=jWzbhxgBdpi/RRpVLMoligdbG/CVha4wdw7TnWD5WioMJ/7wlVVneJZ2ZHHHLMvqFS5Z DCsArxj86ChhaULDDmtTY2vmE50tZjQ5XH1KKYJ3sFQyxYaLRYC2OIPGOg036RBFW7zEvu i2SHYP/GIzieZms51cnxxP4FQiX1TLiGdfRHwJh5g1KfpurMfream10W5AiKw4StDNi8Qc MZTwWRSi7rdV6Gwqw6xMMUAIR93uVae0Xi85GEqd4fUK4hQLKFmign5ckItzG+SadWtSEj S2ml3OvKHSfOEcmzNNzAIRpsXe2FXn/hUMpe3kWu6WDXDg32qx1aofO2eoiT241Q== Received: by recvd-595b9dbf4c-46wzl with SMTP id recvd-595b9dbf4c-46wzl-1-668CCEE4-F 2024-07-09 05:47:16.278873413 +0000 UTC m=+995776.580700595 Received: from herokuapp.com (unknown) by geopod-ismtpd-30 (SG) with ESMTP id EIUd9ix1RuOUPnoQu-zPsw for ; Tue, 09 Jul 2024 05:47:16.218 +0000 (UTC) Date: Tue, 09 Jul 2024 05:47:16 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20620 X-Redmine-Issue-Author: dentarg X-Redmine-Issue-Priority: Normal X-Redmine-Sender: dentarg 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-Redmine-MailingListIntegration-Message-Ids: 95145 X-SG-EID: =?us-ascii?Q?u001=2EH9I7SD4gklZDQY8GJEFStUo9kNfZc0RqUJt4vbygbgXwU26LQkzYRlz6u?= =?us-ascii?Q?LRcrvkkRq8CG5iPffHSXUuOs7gypOzgu1RbEBKI?= =?us-ascii?Q?ovi2le7a5RayqboXI38ZZhs5a4fZ5xOez6RVq03?= =?us-ascii?Q?LymOchDdI9TcogkYGZK2x8yPocn3qIYcshIazpT?= =?us-ascii?Q?TUirmg9vsjECsV3RX=2F9vZPjjsucB=2FW2lBz5Uze3?= =?us-ascii?Q?D8AgyYS+LAIfHzBfYCqasg0TYl7A0oB9N0by2eK?= =?us-ascii?Q?XfHD9tGMEYEFmSfu0SqQmB7e0A=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: NBHJ5LSBOPB27IHDPBIPANDKICXWTCVY X-Message-ID-Hash: NBHJ5LSBOPB27IHDPBIPANDKICXWTCVY X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:118514] [Ruby master Bug#20620] singleton_method undefined for module using "extend self" List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "dentarg (Patrik Ragnarsson) via ruby-core" Cc: "dentarg (Patrik Ragnarsson)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20620 has been reported by dentarg (Patrik Ragnarsson). ---------------------------------------- Bug #20620: singleton_method undefined for module using "extend self" https://bugs.ruby-lang.org/issues/20620 * Author: dentarg (Patrik Ragnarsson) * Status: Open * ruby -v: ruby 3.4.0dev (2024-07-08T21:43:28Z master e500222de1) [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Is this a bug? I expected `ExtendSelf.singleton_method(:foo)` to work when `ExtendSelf.singleton_methods` worked and `:foo` was in the list returned. ```ruby # singleton_method.rb class Klass def self.foo end end module ExtendSelf extend self def foo end end p RUBY_DESCRIPTION p "Klass" p Klass.singleton_methods # => [:foo] p Klass.singleton_method(:foo) # => # p "ExtendSelf" p ExtendSelf.singleton_methods # => [:foo] p ExtendSelf.singleton_method(:foo) # => singleton_method.rb:19:in `singleton_method': undefined singleton method `foo' for `ExtendSelf' (NameError) ``` ```shell $ docker run --rm -it -v $(pwd):/app -w /app rubylang/ruby:master-nightly-jammy Unable to find image 'rubylang/ruby:master-nightly-jammy' locally master-nightly-jammy: Pulling from rubylang/ruby ... Digest: sha256:922037b184b897786a26b2460f70a66139f87dce67f20ddf760cd4186790ed9f root@9807305c322a:/app# ruby -v ruby 3.4.0dev (2024-07-08T21:43:28Z master e500222de1) [x86_64-linux] root@9807305c322a:/app# ruby singleton_method.rb "ruby 3.4.0dev (2024-07-08T21:43:28Z master e500222de1) [x86_64-linux]" "Klass" [:foo] # "ExtendSelf" [:foo] singleton_method.rb:21:in 'Kernel#singleton_method': undefined singleton method 'foo' for 'ExtendSelf' (NameError) ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/