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

NullPointerException with REPL on attribute with unsupported type #2929

Closed
p6rt opened this issue Oct 16, 2012 · 7 comments
Closed

NullPointerException with REPL on attribute with unsupported type #2929

p6rt opened this issue Oct 16, 2012 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 16, 2012

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

Searchable as RT115310$

@p6rt
Copy link
Author

p6rt commented Oct 16, 2012

From @edwinst

$ ./perl6

class A { has @​.a of int }
Null PMC access in get_string()

$ ./perl6 --version
This is perl6 version 2012.09.1-30-g8230aef built on parrot 4.4.0 revision RELEASE_4_4_0

Seems to be REPL-specific​:

$ ./perl6 -e 'class A { has @​.a of int }'
===SORRY!===
Cannot call 'trait_mod​:<of>'; none of these signatures match​:
:(Routine​:D $target, Mu​:U $type)
:(Mu​:U $target, Mu​:U $type)

at -e​:1

@p6rt
Copy link
Author

p6rt commented Apr 1, 2015

From @usev6

As a status update​: The REPL with rakudo.jvm gives a NullPointerException​:

$ echo 'class A { has @​.a of int }' | perl6-j

class A { has @​.a of int }
java.lang.NullPointerException

Executing the command with -e the error message is unchanged (it's the same error when evaluating the code in the REPL with rakudo.moar)​:

$ perl6 -e 'class A { has @​.a of int }'
===SORRY!=== Error while compiling -e
Cannot call trait_mod​:<of>(Attribute, int); none of these signatures match​:
  (Mu​:U $target, Mu​:U $type)
  (Routine​:D $target, Mu​:U $type)
  (Variable​:D $v, Any |c)
  (Variable​:D $v, Mu​:U $of)
at -e​:1
------>

With parrot (latest version from rakudo star 2015.02 it's still a Null PMC access with the REPL​:

$ echo 'class A { has @​.a of int }' | perl6-p

class A { has @​.a of int }
Null PMC access in get_string()

I'll change the subject to mention the NPE on JVM.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Apr 1, 2015

From @usev6

As a status update​: The REPL with rakudo.jvm gives a NullPointerException​:

$ echo 'class A { has @​.a of int }' | perl6-j

class A { has @​.a of int }
java.lang.NullPointerException

Executing the command with -e the error message is unchanged (it's the same error when evaluating the code in the REPL with rakudo.moar)​:

$ perl6 -e 'class A { has @​.a of int }'
===SORRY!=== Error while compiling -e
Cannot call trait_mod​:<of>(Attribute, int); none of these signatures match​:
  (Mu​:U $target, Mu​:U $type)
  (Routine​:D $target, Mu​:U $type)
  (Variable​:D $v, Any |c)
  (Variable​:D $v, Mu​:U $of)
at -e​:1
------>

With parrot (latest version from rakudo star 2015.02 it's still a Null PMC access with the REPL​:

$ echo 'class A { has @​.a of int }' | perl6-p

class A { has @​.a of int }
Null PMC access in get_string()

I'll change the subject to mention the NPE on JVM.

@p6rt
Copy link
Author

p6rt commented Apr 1, 2015

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Nov 28, 2015

From @usev6

This works now​:

$ perl6-m -e 'class A { has @​.a of int }; my $foo = A.new; $foo.a = 1,2,3; say $foo.perl'
A.new(a => array[int].new(1, 2, 3))

Also, there is no NPE with the REPL​:

$ echo 'class A { has @​.a of int }' | perl6-j

I added a test to S12-class/attributes.t with commit Raku/roast@311b07e6b8

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Nov 28, 2015

From @usev6

This works now​:

$ perl6-m -e 'class A { has @​.a of int }; my $foo = A.new; $foo.a = 1,2,3; say $foo.perl'
A.new(a => array[int].new(1, 2, 3))

Also, there is no NPE with the REPL​:

$ echo 'class A { has @​.a of int }' | perl6-j

I added a test to S12-class/attributes.t with commit Raku/roast@311b07e6b8

I'm closing this ticket as 'resolved'.

@p6rt p6rt closed this as completed Nov 28, 2015
@p6rt
Copy link
Author

p6rt commented Nov 28, 2015

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

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant