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

Perl5's bless can't bless #186

Open
DarthGandalf opened this issue Dec 2, 2023 · 0 comments
Open

Perl5's bless can't bless #186

DarthGandalf opened this issue Dec 2, 2023 · 0 comments

Comments

@DarthGandalf
Copy link

DarthGandalf commented Dec 2, 2023

use lib:from<Perl5> '../libp5/lib/perl5';
use Graph::Implicit:from<Perl5>;

my $graph = Graph::Implicit.new(sub {
	my @x;
	return @x;
});
$graph.astar(1, sub { 1 });

Implementation of Graph::Implicit::new looks like this:

sub new {
    my $class = shift;
    my $edge_calculator = shift;
    return bless $edge_calculator, $class;
} 

So it tries to bless the Sub passed to it as Graph::Implicit. But then next line in the Raku code breaks, because Sub doesn't have a method called astar: No such method 'astar' for invocant of type 'Sub'. Did you mean 'Str'?

Environment: Gentoo Linux, Rakudo v2023.10.

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

1 participant