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 EF7B71F44D for ; Mon, 22 Apr 2024 06:09:37 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=MVVUxrzk; 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=iEj41kEO; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 5F0C4843E0; Mon, 22 Apr 2024 06:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1713766162; bh=JA4ZTevLAmCxmRs/lS5C4CeQFf+wWXjBK+jUF30weVs=; 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=MVVUxrzkT8itpMuGGPaWfGuoXl7QUTpuj6n4iZEEkVYPz8fjs/lVR/Oqy8Ie8EIyO fdHhwTE7cutK/4l882vQ+sCQ8I4OX7VI/0M/RLN4H7Oo+WPcYyVSV+H1r5ugkD0I24 UBhgQeTRXFVFS21ytQuwh+Vg1a9ABErLXUfdKbjI= Received: from s.wfbtzhsv.outbound-mail.sendgrid.net (s.wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) by nue.mailmanlists.eu (Postfix) with ESMTPS id E007D84355 for ; Mon, 22 Apr 2024 06:09:17 +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=iEj41kEO; dkim-atps=neutral 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=TZxJUifACuRoUb9aa/NaWAg9Y1Fk+o2nTMdpHw280tg=; b=iEj41kEO60tVM3O2asFYPCZ8PAudTw0zNn1l52Zq6TNDy0C5sDlG9pIPWW8RK4rsjRD0 9Ig9x0nijJ5KGXDBcMwVXHJMJUFI/rMpjERm/kz+jWJCkubiQ7tvGRjJaEHk+sXH4DeZq+ nMJ/dTHS9ryZtuLj2PsIiN/AMhzdM/msaRRZ2oRLS98F5lwH6/CipJmqdXNOk+1/tXkcBU HThB6Knpboy40cgvFrgfqWblPKfxZaugQxO1SqNwEaiC0/oizZBeW5l9g8soHcKu4QOFlC MbM3yc19ePByZgQ9lXiQNEBOHYMsYXwICpB7cJrKTuQydB+2jG+3jFwJvv8TS5Bg== Received: by recvd-547d99795c-jdrrf with SMTP id recvd-547d99795c-jdrrf-1-6625FF0C-11 2024-04-22 06:09:16.971508398 +0000 UTC m=+806947.228178614 Received: from herokuapp.com (unknown) by geopod-ismtpd-29 (SG) with ESMTP id IfRWII3hQPCDH5J2VYw-Gw for ; Mon, 22 Apr 2024 06:09:16.959 +0000 (UTC) Date: Mon, 22 Apr 2024 06:09:17 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20442 X-Redmine-Issue-Author: k776 X-Redmine-Issue-Priority: Normal X-Redmine-Sender: k776 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: 94236 X-SG-EID: =?us-ascii?Q?u001=2EEvQC7tsJDa0hw4L0bBTdOOzpK3d2QfyY6anPE4j8JAfTOP68sOEdIeshK?= =?us-ascii?Q?jIUK+rbF5xz8B318C9wKcXnNnzupaEQBRpPjoRW?= =?us-ascii?Q?1LDTHEyRdE3psiHq8YmB9BYUnvQo1VbrSZoSmY2?= =?us-ascii?Q?gKcBKxr5YM4EWVk6M9ty7DAYp75EjRuRfiRxOJO?= =?us-ascii?Q?S6i5vHi895aQbVq2+Gie=2FQxEq+Tj9T8Ok=2F=2F0nTg?= =?us-ascii?Q?ns300FJkJVHonsOzFIEikjWpQEkIj=2FrX8u4SGDQ?= =?us-ascii?Q?42w00MwcntaUqSss=2F6+x6=2FN6Qw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: LS4ACXQVZRWH2KCRBNNLIS5CKRDWPCKM X-Message-ID-Hash: LS4ACXQVZRWH2KCRBNNLIS5CKRDWPCKM 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.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:117640] [Ruby master Bug#20442] Printing class variable inconsistent when using nested hashes List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "k776 (Kieran Pilkington) via ruby-core" Cc: "k776 (Kieran Pilkington)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20442 has been reported by k776 (Kieran Pilkington). ---------------------------------------- Bug #20442: Printing class variable inconsistent when using nested hashes https://bugs.ruby-lang.org/issues/20442 * Author: k776 (Kieran Pilkington) * Status: Open * ruby -v: 3.3.0 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- See attached test.rb. I have a class with a class variable. The idea is simple, increment the value and then print out the resulting class var. ``` Mock1 0 1 Mock2 {} {"a"=>1} Mock3 {} {"a"=>1} Mock4 {} {} ``` Mock1 through Mock3 are working as expected. But Mock4 does not, it outputs a blank hash, rather than the expected: `{"a"=>{"a"=>1}}` The value is being set. If I replace the print method with `@val['a']['a']` is outputs the number 1 as expected. ---Files-------------------------------- test.rb (820 Bytes) -- 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/postorius/lists/ruby-core.ml.ruby-lang.org/