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

Error when attempting to use a package that has one of core namespaces in its name #5815

Open
p6rt opened this issue Nov 28, 2016 · 8 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Nov 28, 2016

Migrated from rt.perl.org#130200 (status was 'open')

Searchable as RT130200$

@p6rt
Copy link
Author

p6rt commented Nov 28, 2016

From winexpertu@yandex.ru

Version​: Rakudo version 2016.11 built on MoarVM version 2016.11 implementing Perl 6.c.
OS​: Windows 10 x64.

Example of the issue​:

  package Attribute​::Foo { };
  use Attribute​::Foo;

Attempting to compile such code produces a misleading error message​: "Attribute​::Foo is a builtin type, not an external module".

@p6rt
Copy link
Author

p6rt commented Nov 28, 2016

From @zoffixznet

The error is even weirder here​:

m​: package IO​::Foo { }; use IO​::Foo
rakudo-moar 054aca​: OUTPUT«===SORRY!===␤»

@p6rt
Copy link
Author

p6rt commented Nov 28, 2016

From @zoffixznet

On Mon, 28 Nov 2016 05​:38​:23 -0800, cpan@​zoffix.com wrote​:

The error is even weirder here​:

m​: package IO​::Foo { }; use IO​::Foo
rakudo-moar 054aca​: OUTPUT«===SORRY!===␤»

Oh, that one was just a glitch in camelia. The error is the same for IO​:: as for Attribute​::

m​: package IO​::Foo { }; use IO​::Foo
rakudo-moar 054aca​: OUTPUT«===SORRY!===␤IO​::Foo is a builtin type, not an external module␤»

@p6rt
Copy link
Author

p6rt commented Dec 27, 2017

From @zoffixznet

On Mon, 28 Nov 2016 05​:41​:48 -0800, cpan@​zoffix.com wrote​:

On Mon, 28 Nov 2016 05​:38​:23 -0800, cpan@​zoffix.com wrote​:

The error is even weirder here​:

m​: package IO​::Foo { }; use IO​::Foo
rakudo-moar 054aca​: OUTPUT«===SORRY!===␤»

Oh, that one was just a glitch in camelia. The error is the same for
IO​:: as for Attribute​::

m​: package IO​::Foo { }; use IO​::Foo
rakudo-moar 054aca​: OUTPUT«===SORRY!===␤IO​::Foo is a builtin type, not
an external module␤»

One more issue in this bunch, caused by presence of `role X` and invalid method call​:

  $ perl6 -e 'class Foo { role X {}; method z { Foo!z } }'
  ===SORRY!===
  Could not locate compile-time value for symbol Method​::NotFound

@p6rt
Copy link
Author

p6rt commented Dec 27, 2017

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

@p6rt
Copy link
Author

p6rt commented Dec 29, 2017

From @zoffixznet

On Wed, 27 Dec 2017 05​:17​:34 -0800, cpan@​zoffix.com wrote​:

On Mon, 28 Nov 2016 05​:41​:48 -0800, cpan@​zoffix.com wrote​:

On Mon, 28 Nov 2016 05​:38​:23 -0800, cpan@​zoffix.com wrote​:

The error is even weirder here​:

m​: package IO​::Foo { }; use IO​::Foo
rakudo-moar 054aca​: OUTPUT«===SORRY!===␤»

Oh, that one was just a glitch in camelia. The error is the same for
IO​:: as for Attribute​::

m​: package IO​::Foo { }; use IO​::Foo
rakudo-moar 054aca​: OUTPUT«===SORRY!===␤IO​::Foo is a builtin type,
not
an external module␤»

One more issue in this bunch, caused by presence of `role X` and
invalid method call​:

$ perl6 -e 'class Foo { role X {}; method z { Foo!z } }'
===SORRY!===
Could not locate compile-time value for symbol Method​::NotFound

  $ perl6 -v
  This is Rakudo version 2017.12-11-g2a8287c built on MoarVM version 2017.12-1-g912f967
  implementing Perl 6.c.

  $ cat Foo.pm6
  unit class Foo;
  class Z​::Bar {}
  class X​::Meow {}

  $ perl6 -I. -MFoo -e 'say Foo​::Z​::Bar; say Foo​::X​::Meow'
  (Bar)
  Could not find symbol '&Meow'
  in block <unit> at -e line 1

  $ pico Foo.pm6 ...

  $ cat Foo.pm6
  unit class Foo;
  class Foo​::Z​::Bar {}
  class Foo​::X​::Meow {}

  $ perl6 -I. -MFoo -e 'say Foo​::Z​::Bar; say Foo​::X​::Meow'
  (Bar)
  (Meow)

Another related case. Namespace of inner class begins with core namespace is not found, but with class's namespace then found.

@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
@Leont
Copy link

Leont commented Feb 14, 2022

I just also ran into this issue, it's still a problem and it's quite confusing behavior

@lizmat
Copy link
Contributor

lizmat commented Feb 14, 2022

I think we need to keep this in mind with the RakuAST work.

Leont added a commit to Leont/protocol-postgres that referenced this issue Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

3 participants