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

Weird interaction between constants, Xops and pre-comp. #4898

Open
p6rt opened this issue Dec 20, 2015 · 3 comments
Open

Weird interaction between constants, Xops and pre-comp. #4898

p6rt opened this issue Dec 20, 2015 · 3 comments
Labels
Bug

Comments

@p6rt
Copy link

@p6rt p6rt commented Dec 20, 2015

Migrated from rt.perl.org#126974 (status was 'new')

Searchable as RT126974$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Dec 20, 2015

From @thundergnat

If I build constant arrays, use those arrays to built _other_ constant
arrays
with meta operators and then try to access those arrays from a pre compiled
module, I get an error​: "Cannot invoke this object"

It doesn't seem to happen if the arrays are declared "my" array,
It doesn't seem to happen if I don't use Meta operators to build the arrays.
It doesn't seem to happen when run in the same file, only when pre-compiled
and loaded as a module.

May be an example of DIHWIDT, but I spent several hours tracking
down errors that only occurred when code got packaged as a module
and pre-compiled.

See​: https://github.com/thundergnat/Lingua-EN-Numbers-Cardinal
for larger example.

Demo files attached​: Bogus.pm6 and bogus.p6

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Dec 20, 2015

From @thundergnat

use lib '.';
use Bogus;
say broken(2);

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Dec 20, 2015

From @thundergnat

use v6;

unit module Bogus;

constant @​d = < a b c d e >;
constant @​e = @​d X~ ' test';
constant @​f = @​d »~» ' test';

sub broken ($a) is export {
  say @​f[$a];
  say @​e[$a];
}

#broken(2);

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.