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

You can sneak a Block into a variable typed as a Whatever in Rakudo #1598

Closed
p6rt opened this issue Mar 9, 2010 · 5 comments
Closed

You can sneak a Block into a variable typed as a Whatever in Rakudo #1598

p6rt opened this issue Mar 9, 2010 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 9, 2010

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

Searchable as RT73460$

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

From @masak

<moritz_> rakudo​: my $x = *; say $x.WHAT
<p6eval> rakudo de996e​: OUTPUT«Block()␤»
<moritz_> now that's... confusing
<masak> nod.
<moritz_> rakudo​: say *.WHAT
<p6eval> rakudo de996e​: OUTPUT«Whatever()␤»
<masak> rakudo​: say Block ~~ Whatever
<p6eval> rakudo de996e​: OUTPUT«0␤»
<masak> rakudo​: my Whatever $x = *; say $x.WHAT
<p6eval> rakudo de996e​: OUTPUT«Block()␤»
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Jul 15, 2010

From @jnthn

On Tue Mar 09 03​:14​:37 2010, masak wrote​:

<moritz_> rakudo​: my $x = *; say $x.WHAT
<p6eval> rakudo de996e​: OUTPUT«Block()␤»
<moritz_> now that's... confusing
<masak> nod.

Now​:

my $x = *; say $x.WHAT
Whatever()

<moritz_> rakudo​: say *.WHAT
<p6eval> rakudo de996e​: OUTPUT«Whatever()␤»

say *.WHAT
Whatever()

<masak> rakudo​: say Block ~~ Whatever
<p6eval> rakudo de996e​: OUTPUT«0␤»

Still works as expected.

<masak> rakudo​: my Whatever $x = *; say $x.WHAT
<p6eval> rakudo de996e​: OUTPUT«Block()␤»

my Whatever $x = *; say $x.WHAT
Whatever()

Given to moritz++ for test coverage of these.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Jul 15, 2010

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

@p6rt
Copy link
Author

p6rt commented Jul 15, 2010

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

@p6rt p6rt closed this as completed Jul 15, 2010
@p6rt
Copy link
Author

p6rt commented Jul 15, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S02-builtin_data_types/whatever.t

commit 00c99647a074586660ac551d94a564fdd29c842a
Author​: moritz <moritz@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Thu Jul 15 19​:04​:00 2010 +0000

  [t/spec] tests for RT #​73460, Whatever stars and variables
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31714 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S02-builtin_data_types/whatever.t b/t/spec/S02-builtin_data_types/whatever.t
index 30d572a..94898d3 100644
--- a/t/spec/S02-builtin_data_types/whatever.t
+++ b/t/spec/S02-builtin_data_types/whatever.t
@@ -8,7 +8,12 @@ plan *;
 
 {
     my $x = *;
-    ok($x.isa(Whatever), 'can assign * to a variable and isa works');
+    isa_ok $x, Whatever, 'can assign * to a variable and isa works';
+
+    my Whatever $y;
+    ok $y.WHAT === Whatever, 'can type variables with Whatever';
+
+    ok *.WHAT === Whatever, '*.WHAT does not autocurry';
 }
 
 # L<S02/Built-In Data Types/"Most of the built-in numeric operators">

@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