Description of problem: when asking AWK for the type of an array variable, it incorrectly claims that it is untyped. Version-Release number of selected component (if applicable): gawk-4.1.3-8.fc25.i686 How reproducible: always Steps to Reproduce: 1. gawk 'BEGIN { testx["bla"]="foo";testx["bla2"]="foo2";print PROCINFO["identifiers"]["testx"]; split("cul-de-sac",a,"-",seps); print PROCINFO["identifiers"]["a"],PROCINFO["identifiers"]["seps"];}' Actual results: untyped untyped untyped Expected results: array array array Additional info: PROCINFO["identifiers"]["PROCINFO"] correctly reports "array".
Same behavior actually for numbers and strings: % gawk 'BEGIN { x="test"; print PROCINFO["identifiers"]["x"];}' untyped % gawk 'BEGIN { x=5.5; print PROCINFO["identifiers"]["x"];}' untyped
OK I guess it's because "The values indicate what gawk knows about the identifiers after it has finished parsing the program; they are not updated while the program runs." (https://www.gnu.org/software/gawk/manual/gawk.html)
Although I still think it's a bug. In the examples given, the type IS statically known after parsing. Because the respective identifiers are used in only one, unique type of context. 'testx["bla"]="foo"' clearly says that testx is an array, and if there is no conflicting assignment (such as testx = "xyz") afterwards or before, the type must be array. What purpose would PROCINFO have anyway, if it wouldn't handle this basic case well?
Hello Peter, thank you for reporting this. Unfortunately, I'm not part of gawk's upstream, nor I know much about it. You probably know much more than I do, actually... :) Would you be, please, so kind and send your bug report to <bug-gawk>? In case upstream acknowledges this as a bug and fixes it, then I can create a new gawk release for you. (I could report this to upstream on your behalf, but in case they reply I would become just a bottleneck in your communication. If you would write them the same thing you wrote me, it would speed things up much more. Upstream of gawk replies within few days usually. ;)) Thank you for your understanding. Dee'Kej
Reported upstream
(In reply to Peter Backes from comment #5) > Reported upstream Thank you very much! :)
This message is a reminder that Fedora 25 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 25. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '25'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 25 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Based on the discussion @ gawk-bugs upstream's mailing list, I consider this BZ to be resolved in Rawhide for F28 (with rebase to gawk-4.2.0). Please, use the suggested approach by upstream. :) Best regards, -- Dee'Kej --