Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling an undeclared routine in the REPL undeclares all variables #4088

Closed
stuart-little opened this issue Dec 5, 2020 · 4 comments
Closed
Assignees

Comments

@stuart-little
Copy link

The Problem

As the title says: after calling foo(<argument>) for an undefined subroutine foo results in previously-defined variables (unrelated to &f) henceforth registering as undefined.

Expected Behavior

Defined variables unaffected.

Actual Behavior

Defined variables rendered undefined.

Steps to Reproduce

Full REPL session:

> my ($x,$y,$z) = 42, 'string', (1,2,3)              
(42 string (1 2 3))
> 'boo'.&foo
===SORRY!=== Error while compiling:
Undeclared routine:                                      
          foo used at line 2                               
> $x
===SORRY!=== Error while compiling:
Variable '$x' is not declared
------> <BOL>⏏$x
> $y                                                 
===SORRY!=== Error while compiling:
Variable '$y' is not declared                       
 ------> <BOL>⏏$y
> $z                                                 
===SORRY!=== Error while compiling:
Variable '$z' is not declared
------> <BOL>⏏$z

Environment

  • Operating system: x86_64 GNU/Linux
  • Compiler version (perl6 -v or raku -v):
Welcome to Rakudo(tm) v2020.11-95-g6c7044ec3.
Implementing the Raku(tm) programming language v6.d. 
Built on MoarVM version 2020.11-47-g1c7358004.

(compiled from this repo minutes ago, as I type this)

@lizmat
Copy link
Contributor

lizmat commented Dec 5, 2020

Is this a recent change in behaviour?

@stuart-little
Copy link
Author

I certainly don't recall seeing it before, but I compile often; it's hard to keep track of when things change..

@Altai-man
Copy link
Member

It is a regression, 2020.10 is clear.

@lizmat lizmat self-assigned this Dec 5, 2020
@stuart-little
Copy link
Author

And actually, it doesn't seem to have much to do specifically with subroutines:

> my $x=12
12
> $y
===SORRY!=== Error while compiling:
Variable '$y' is not declared
at line 2
------> <BOL>⏏$y
> $x
===SORRY!=== Error while compiling:
Variable '$x' is not declared
------> <BOL>⏏$x

Calling an undeclared variable in general seems to undeclare other variables..

@lizmat lizmat closed this as completed in 6f7718c Dec 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants