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

"use lib" supports only Str, not IO::Path #6335

Closed
p6rt opened this issue Jun 8, 2017 · 4 comments
Closed

"use lib" supports only Str, not IO::Path #6335

p6rt opened this issue Jun 8, 2017 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Jun 8, 2017

Migrated from rt.perl.org#131540 (status was 'resolved')

Searchable as RT131540$

@p6rt
Copy link
Author

p6rt commented Jun 8, 2017

From @Juerd

It'd be nice if I didn't have to stringify this myself​:

  use lib $*PROGRAM.resolve.sibling('lib');

Currently, this results in the following failure​:

  Type check failed in binding to parameter '$spec'; expected Str but
  got IO​::Path

A simple workaround for now is​:

  use lib ~$*PROGRAM.resolve.sibling('lib');

I don't know if the right way involves supporting arguments of IO​::Path
explicitly, or to just coerce them to Str.
--
Met vriendelijke groet, // Kind regards, // Korajn salutojn,

Juerd Waalboer <juerd@​tnx.nl>
TNX

@p6rt
Copy link
Author

p6rt commented Jun 9, 2017

From @zoffixznet

On Thu, 08 Jun 2017 16​:33​:33 -0700, juerd@​tnx.nl wrote​:

It'd be nice if I didn't have to stringify this myself​:

use lib $\*PROGRAM\.resolve\.sibling\('lib'\);

Currently, this results in the following failure​:

Type check failed in binding to parameter '$spec'; expected Str but
got IO&#8203;::Path

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@3ff29d42f026fde
Test​: Raku/roast@0bed3721473fc472e

A simple workaround for now is​:

use lib ~$\*PROGRAM\.resolve\.sibling\('lib'\);

That's actually not a correct way to stringify paths if you wish the string
to refer to the same filesystem object​: https://docs.perl6.org/language/traps#IO::Path_Stringification

@p6rt
Copy link
Author

p6rt commented Jun 9, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jun 9, 2017

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jun 9, 2017
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