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=0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS autolearn=no 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)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4C33C1F47C for ; Thu, 1 Aug 2024 09:33:20 +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=ySSWIlBd; 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=VmRVByXh; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1722504767; bh=n8Hvez2gH1SSGTJSBRkpR/G9LRYxYEBCfPKjACN2XSY=; 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=ySSWIlBd47inrlKUxQLitYfm0qCCWGzzy6jklzgz7TGkzXyErIb1XwkbBW+Yjti0p VE4zmnUDCNDjhHQ1jyZbLUy2zy91t4legB+c6bLWeGTmVd5X7We7iAqVe/7OufNj89 /z6+5KPTLFBQfUqfdZFBDsfPb9JfKg49ikTEwxnQ= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id C444841658 for ; Thu, 1 Aug 2024 09:32:47 +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=VmRVByXh; dkim-atps=neutral Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 68261415D9 for ; Thu, 1 Aug 2024 09:32:37 +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=kLgDuixrrsTTPE2gD1UpIobFpiuKhMhj9tjLH7e3xAU=; b=VmRVByXhiLBFGf6QDB8GqFI3emm1bsWGNJDkZUd4/NR+Z6ZGAWrAHMRdWSOgxyXOXoe2 t7geXkpWpKWang2JVrnra1QhP0m4u3L4f7zgZlT9wYTwfuVoPMMBJYApvuJw27WKthbJA9 HdCiCSwGKY47bzHhx7plSyQwXuuOFtrXWKmFDKoaZtwyplhjDxdfXdl55mQ4D48aQy0RTk PSNs2Wi+4xRgKNavSR+c8lqsy8FB+LXtBrDdixQtYeVjoSgmqCvKZGfpWl/8ejNGWDVoEA 4AZZ97xokqBET4i1j2nzWIIn2c6KAteSMuDvnB0ua15o3/IhBRHC+qT5nrl2Y4xg== Received: by recvd-b887ddd65-5pkw9 with SMTP id recvd-b887ddd65-5pkw9-1-66AB5634-1E 2024-08-01 09:32:36.426568996 +0000 UTC m=+216820.456151512 Received: from herokuapp.com (unknown) by geopod-ismtpd-34 (SG) with ESMTP id jmtNFRgMS_uT0CMsobKysw for ; Thu, 01 Aug 2024 09:32:36.386 +0000 (UTC) Date: Thu, 01 Aug 2024 09:32:36 +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: matz 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: 95395 X-SG-EID: =?us-ascii?Q?u001=2Eqca74XLbbBG2T0HhbEZgBN9E1Qhb0c7bGBe1waNAWdTreSqyWPDekZUgq?= =?us-ascii?Q?NYk4+nm=2F0VIqwc8ZBTQxqk7G=2FctsRLtYG2yTl=2FP?= =?us-ascii?Q?2CaGNETxG2TOQFpfl7OmykHNkD66orqLLXYVSP0?= =?us-ascii?Q?1uc8LQpqyCeTeZ0kyToolgjzy60SKgRUS8G93Py?= =?us-ascii?Q?lHRTasiZtx1Xq3ykH0wfWVzoZnTmBKpWcEO06ht?= =?us-ascii?Q?MrU=2FOESHzEo+YeQeEDhs+Lb091SaWobNKEtvIFw?= =?us-ascii?Q?WDmHvH2IETDX1QZnVTgeXnJ+Ug=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: 3ZPP7H2VUCMWGWUOFDULYZUG6UHQBLDB X-Message-ID-Hash: 3ZPP7H2VUCMWGWUOFDULYZUG6UHQBLDB 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:118764] [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: "matz (Yukihiro Matsumoto) via ruby-core" Cc: "matz (Yukihiro Matsumoto)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20620 has been updated by matz (Yukihiro Matsumoto). I think `singleton_method` should traverse super-classes (as long as they are ICLASS) too. Probably we need to check for compatibility issues. Matz. ---------------------------------------- Bug #20620: singleton_method undefined for module using "extend self" https://bugs.ruby-lang.org/issues/20620#change-109316 * 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/