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

LTA error message when declaring a PrecompStore with default values #2545

Open
JJ opened this issue Dec 14, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@JJ
Copy link
Contributor

commented Dec 14, 2018

The Problem

This program

use nqp;

my $io=$*PROGRAM-NAME.IO;
my $precomp-store = CompUnit::PrecompilationStore::File.new();
my $precomp = CompUnit::PrecompilationRepository::Default.new(store => $precomp-store);

my $id = nqp::sha1(~$*PROGRAM-NAME);
my $handle = $precomp.load($id)[0];

without $handle {
    $precomp.precompile($io, $id, :force);
    $handle = $precomp.load($id)[0] // fail("Could not precompile");
}

say nqp::atkey($handle.unit,'$=pod')[0];

Fails with error:

Invocant of method 'add' must be an object instance of type 'IO::Path', not a type object of type 'IO::Path'.  Did you forget a '.new'?

Expected Behavior

Since this is due to the fact that we are not initializing correctly the named argument prefix, which is getting the default value IO::Path, it would be more awesome if either a reasonable default would be assigned to that argument or an error was thrown at that particular point.

Actual Behavior

No object of that type is actually declared in the script, and it's obscure why that error is being thrown in line

my $handle = $precomp.load($id)[0];

Steps to Reproduce

Run the script above.

Environment

  • Operating system:
  • Compiler version (perl6 -v):

Perl6 2018.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.