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

multi doesn't work with 'is native' #5963

Open
p6rt opened this issue Jan 1, 2017 · 6 comments
Open

multi doesn't work with 'is native' #5963

p6rt opened this issue Jan 1, 2017 · 6 comments

Comments

@p6rt
Copy link

@p6rt p6rt commented Jan 1, 2017

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

Searchable as RT130478$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jan 1, 2017

From kaare@jasonic.dk

This works

use NativeCall;

constant gid_t = uint32;
constant group = class :​: is repr('CStruct') {
  has Str $.name;
  has Str $.password;
  has gid_t $.gid;
  has CArray[Str] $.members;
};

sub getgrgid(int32) returns group is native { * }

my int32 $i = 1;
getgrgid($i);

This doesn't

use NativeCall;

constant gid_t = uint32;
constant group = class :​: is repr('CStruct') {
  has Str $.name;
  has Str $.password;
  has gid_t $.gid;
  has CArray[Str] $.members;
};

multi sub getgrgid(int32) returns group is native { * }
multi sub getgrgid(Int) { say 'Hi' }

my int32 $i = 1;
getgrgid($i);

Shouldn't it?

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jan 1, 2017

From @zoffixznet

On Sun, 01 Jan 2017 04​:49​:38 -0800, kaare@​jasonic.dk wrote​:

This works

use NativeCall;

constant gid_t = uint32;
constant group = class :​: is repr('CStruct') {
has Str $.name;
has Str $.password;
has gid_t $.gid;
has CArray[Str] $.members;
};

sub getgrgid(int32) returns group is native { * }

my int32 $i = 1;
getgrgid($i);

This doesn't

use NativeCall;

constant gid_t = uint32;
constant group = class :​: is repr('CStruct') {
has Str $.name;
has Str $.password;
has gid_t $.gid;
has CArray[Str] $.members;
};

multi sub getgrgid(int32) returns group is native { * }
multi sub getgrgid(Int) { say 'Hi' }

my int32 $i = 1;
getgrgid($i);

Shouldn't it?

What does "doesn't work" mean? Please be specific about the problem and include your perl6 --version

On my HEAD build the second one fails with

Cannot invoke object with invocation handler in this context
  in sub getgrgid at test.p6 line 11
  in block <unit> at test.p6 line 15

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jan 1, 2017

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

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jan 1, 2017

From kaare@jasonic.dk

What does "doesn't work" mean? Please be specific about the problem and include your perl6 --version

On my HEAD build the second one fails with

Cannot invoke object with invocation handler in this context
in sub getgrgid at test.p6 line 11
in block <unit> at test.p6 line 15

I'm not impressed with the bug tracking. No link provided in the email, and my reply with the follow-up information got lost. Today 15.35 I wrote

Perhaps it would be an idea to include the error message​:

Cannot invoke object with invocation handler in this context

  in sub getgrgid at b line 11

  in block <unit> at b line 15

and the perl6 --version

This is Rakudo version 2016.12-118-g3baffe7 built on MoarVM version 2016.12-21-g3dc5647

implementing Perl 6.c.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jan 2, 2017

From kaare@jasonic.dk

What does "doesn't work" mean? Please be specific about the problem and include your perl6 --version

On my HEAD build the second one fails with

Cannot invoke object with invocation handler in this context
in sub getgrgid at test.p6 line 11
in block <unit> at test.p6 line 15

I'm not impressed with the bug tracking. No link provided in the email,
and my reply with the follow-up information got lost. Today 15.35 I wrote

Perhaps it would be an idea to include the error message​:

Cannot invoke object with invocation handler in this context

  in sub getgrgid at b line 11

  in block <unit> at b line 15

and the perl6 --version

This is Rakudo version 2016.12-118-g3baffe7 built on MoarVM version
2016.12-21-g3dc5647

implementing Perl 6.c.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jan 2, 2017

From kaare@jasonic.dk

Perhaps it would be an idea to include the error message​:

Cannot invoke object with invocation handler in this context

  in sub getgrgid at b line 11

  in block <unit> at b line 15

and the perl6 --version

This is Rakudo version 2016.12-118-g3baffe7 built on MoarVM version 2016.12-21-g3dc5647

implementing Perl 6.c.

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.