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

Null PMC access when typing a variable as ::foo in Rakudo #1822

Closed
p6rt opened this issue Jun 9, 2010 · 18 comments
Closed

Null PMC access when typing a variable as ::foo in Rakudo #1822

p6rt opened this issue Jun 9, 2010 · 18 comments

Comments

@p6rt
Copy link

p6rt commented Jun 9, 2010

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

Searchable as RT75646$

@p6rt
Copy link
Author

p6rt commented Feb 15, 2010

From @masak

<diakopter> rakudo​: my :​:byte $a
<p6eval> rakudo 70667a​: OUTPUT«Null PMC access in type() [...]
<diakopter> rakudo​: my :​:Byte $a
<p6eval> rakudo 70667a​: OUTPUT«Null PMC access in type() [...]
<masak> I think I can rakudobug those.
<masak> rakudo​: my :​:a $a
<p6eval> rakudo 70667a​: OUTPUT«Null PMC access in type() [...]
* masak submits rakuodbug

@p6rt
Copy link
Author

p6rt commented Jun 9, 2010

From @masak

<diakopter> rakudo​: my :​:foo $x; say $x
<p6eval> rakudo a54677​: OUTPUT«Null PMC access in type() [...]
* masak submits rakudobug
<masak> a phantom-typed variable!
<diakopter> uh oh.
<diakopter> masak​: you're encouraging my rakudofuzzing
<masak> of course!
<jnthn> I'm pretty sure :​:whatever exploding is already in there.
<masak> there are related tickets, for sure​:
http://rt.perl.org/rt3/Ticket/Display.html?id=64642 is one.
<masak> but I find none exactly like this. so I'm submitting it.
<jnthn> I've no idea what we're supposed to do in such cases
<masak> fail at compile-time? ignore the typing? let demons fly out of
the user's nose?
<jnthn> I'd prefer a Null PMC Access to my nose demons escaping.
<jnthn> Maybe the spec says what to do somewhere. :-)
<masak> maybe.

@p6rt
Copy link
Author

p6rt commented Jun 9, 2010

From @masak

<jnthn> rakudo​: my :​:foo $x;
<p6eval> rakudo a54677​: OUTPUT«Null PMC access in type() [...]
<jnthn> masak​: You only got a birdie, not a hole in one. :P
<masak> jnthn​: will update the ticket.
<diakopter> hee
<jnthn> :-)
<jnthn> masak​: Yeah, I was looking at it thinking "hmm, I know how that code works and I'm
surprised we make it past the declaration" :)

@p6rt
Copy link
Author

p6rt commented Jun 9, 2010

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

@p6rt
Copy link
Author

p6rt commented Jun 27, 2010

From radu_cs85@yahoo.com

Added test in S04-declarations/my.t

@p6rt
Copy link
Author

p6rt commented Jun 27, 2010

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

@p6rt
Copy link
Author

p6rt commented Jun 27, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S04-declarations/my.t

commit 1614779058b7c8f759221f1614ba3fab04992895
Author​: radus <radus@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sun Jun 27 09​:20​:19 2010 +0000

  [t/spec] Added test for RT 72814 - Null PMC access when typing a my-declared variable as :​:a in Rakudo.
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31475 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S04-declarations/my.t b/t/spec/S04-declarations/my.t
index 6f23c04..25145f7 100644
--- a/t/spec/S04-declarations/my.t
+++ b/t/spec/S04-declarations/my.t
@@ -1,7 +1,7 @@
 use v6;
 use Test;
 
-plan 62;
+plan 63;
 
 #L<S04/The Relationship of Blocks and Declarations/"declarations, all
 # lexically scoped declarations are visible"> 
@@ -247,4 +247,11 @@ eval_lives_ok 'my (%h?)', 'my (%h?) lives';
 eval_lives_ok 'my $x = 3; class A { has .$y = $x; }; say A.new.y', 
         'global scoped variables are visible inside class definitions';
 
+#RT #72814
+
+{
+    #?rakudo skip 'RT 72814' 
+    lives_ok {my ::a $a}, 'typing a my-declared variable as ::a works.';
+}
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Sep 13, 2011

From @bbkr

NOM​: mentioned test is already unfudged and passing

@p6rt
Copy link
Author

p6rt commented Sep 13, 2011

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

@p6rt
Copy link
Author

p6rt commented Sep 20, 2011

From @coke

On Wed Jun 09 14​:45​:50 2010, masak wrote​:

<jnthn> rakudo​: my :​:foo $x;
<p6eval> rakudo a54677​: OUTPUT�Null PMC access in type() [...]
<jnthn> masak​: You only got a birdie, not a hole in one. :P
<masak> jnthn​: will update the ticket.
<diakopter> hee
<jnthn> :-)
<jnthn> masak​: Yeah, I was looking at it thinking "hmm, I know how
that code works and I'm
surprised we make it past the declaration" :)

Now they say​:

00​:19 < [Coke]> rakudo​: my :​:foo $x; say $x
00​:19 <+p6eval> rakudo cbdd9b​: OUTPUT«Cannot call a method on type variable foo␤ in
  find_method at src/gen/Metamodel.pm​:261␤ in sub say at
  src/gen/CORE.setting​:4722␤ in sub say at src/gen/CORE.setting​:4729␤
  in <anon> at /tmp/ormgC9k2j3​:1␤ in <anon> at /tmp/ormgC9k2j3​:1␤␤»
00​:19 < [Coke]> rakudo​: my :​:foo $x;
00​:19 <+p6eval> rakudo cbdd9b​: ( no output )
00​:19 < [Coke]> rakudo​: my :​:foo $x; say "alive"
00​:19 <+p6eval> rakudo cbdd9b​: OUTPUT«alive␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 28, 2014

From @usev6

The Null PMC access is gone, so I'm closing this ticket.

The error message has changed slightly​:

$ perl6-m -e 'my :​:foo $x; say $x'
Cannot type check against type variable foo
  in any type_check at src/gen/m-Metamodel.nqp​:297
  in block <unit> at -e​:1

I added a test for this exception to S02-names-vars/names.t with commit Raku/roast@5e0641d092

If you don't think current behaviour is correct, please reopen the ticket.

Also, there was another Ticket (#​72814; with test in S04-declarations/my.t) about the Null PMC access with 'my :​:foo $x;'. I'm gonna merge both tickets.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 28, 2014

From @usev6

The Null PMC access is gone, so I'm closing this ticket.

The error message has changed slightly​:

$ perl6-m -e 'my :​:foo $x; say $x'
Cannot type check against type variable foo
  in any type_check at src/gen/m-Metamodel.nqp​:297
  in block <unit> at -e​:1

I added a test for this exception to S02-names-vars/names.t with commit Raku/roast@5e0641d092

If you don't think current behaviour is correct, please reopen the ticket.

Also, there was another Ticket (#​72814; with test in S04-declarations/my.t) about the Null PMC access with 'my :​:foo $x;'. I'm gonna merge both tickets.

@p6rt
Copy link
Author

p6rt commented Oct 28, 2014

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

@p6rt
Copy link
Author

p6rt commented Oct 31, 2015

From @coke

On Tue Oct 28 14​:41​:35 2014, bartolin@​gmx.de wrote​:

The Null PMC access is gone, so I'm closing this ticket.

The error message has changed slightly​:

$ perl6-m -e 'my :​:foo $x; say $x'
Cannot type check against type variable foo
in any type_check at src/gen/m-Metamodel.nqp​:297
in block <unit> at -e​:1

I added a test for this exception to S02-names-vars/names.t with
commit Raku/roast@5e0641d092

If you don't think current behaviour is correct, please reopen the
ticket.

Also, there was another Ticket (#​72814; with test in S04-
declarations/my.t) about the Null PMC access with 'my :​:foo $x;'. I'm
gonna merge both tickets.

This test now dies on the JVM with a java.lang.StackOverflowError

re-opening ticket.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 31, 2015

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

@p6rt
Copy link
Author

p6rt commented Jul 16, 2016

From @usev6

The test passes again (rakudo-j). I'm closing this ticket as resolved.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jul 16, 2016

From @usev6

The test passes again (rakudo-j). I'm closing this ticket as resolved.

@p6rt
Copy link
Author

p6rt commented Jul 16, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant