From 02641edbceded7865998e8d6d548aac8926ef347 Mon Sep 17 00:00:00 2001 From: "Flavio S. Glock" Date: Fri, 15 May 2026 11:38:07 +0200 Subject: [PATCH] fix: stash hash assignment with numeric RHS (Test::MockObject fake_module) Delegate INTEGER/DOUBLE/etc. RuntimeStashEntry assignments to RuntimeGlob so patterns like `${"Pkg/"}{VERSION} ||= -1` install into the GV scalar slot instead of throwing. Unblocks jcpan tests for Finance::Currency::Convert::WebserviceX. Generated with [Cursor](https://cursor.com/docs) Co-Authored-By: Cursor Co-authored-by: Cursor --- .../runtime/runtimetypes/RuntimeStashEntry.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/org/perlonjava/runtime/runtimetypes/RuntimeStashEntry.java b/src/main/java/org/perlonjava/runtime/runtimetypes/RuntimeStashEntry.java index da3374652..c1eb9243a 100644 --- a/src/main/java/org/perlonjava/runtime/runtimetypes/RuntimeStashEntry.java +++ b/src/main/java/org/perlonjava/runtime/runtimetypes/RuntimeStashEntry.java @@ -232,6 +232,16 @@ public RuntimeScalar set(RuntimeScalar value) { // TODO: Add "Undefined value assigned to typeglob" warning with proper guards // to avoid false positives during module loading return value; + case INTEGER: + case DOUBLE: + case BOOLEAN: + case VSTRING: + case DUALVAR: + // Stash-hash assignment with a numeric or other non-string scalar (e.g. + // `${"HTTP/Response::"}{VERSION} ||= -1` from Test::MockObject::fake_module) + // updates the GV's scalar slot, not subroutine prototype metadata — delegate + // to RuntimeGlob. + return super.set(value); case STRING: case BYTE_STRING: // Assigning a string to a stash entry sets the prototype for that symbol