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

monkey-typed method new is not called #1931

Closed
p6rt opened this issue Jul 12, 2010 · 5 comments
Closed

monkey-typed method new is not called #1931

p6rt opened this issue Jul 12, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jul 12, 2010

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

Searchable as RT76476$

@p6rt
Copy link
Author

p6rt commented Jul 12, 2010

From @moritz

19​:13 <@​jnthn> rakudo​: use MONKEY_TYPING; class Foo { }; augment class
Foo {
  method new { say "called" } }; Foo.new
19​:13 <+p6eval> rakudo bb6df2​: ( no output )
19​:14 <@​jnthn> hmpfth
19​:14 * moritz_ submits rakudobug

@p6rt
Copy link
Author

p6rt commented Jul 18, 2010

From @kyleha

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

commit f2824799ff1c44418b7348893d9d6353b96d4771
Author​: moritz <moritz@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sun Jul 18 14​:29​:41 2010 +0000

  [t/spec] test for RT #​76476, monkey-typed method new is not called
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31751 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S12-construction/construction.t b/t/spec/S12-construction/construction.t
index 16b1573..dd91430 100644
--- a/t/spec/S12-construction/construction.t
+++ b/t/spec/S12-construction/construction.t
@@ -2,7 +2,7 @@ use v6;
 
 use Test;
 
-plan 14;
+plan 15;
 
 # L<S12/"Construction and Initialization">
 
@@ -76,4 +76,17 @@ is Foo.new("a string").a, 'a string', "our own 'new' was called";
     is $a.env<foo>, 'bar', 'assignment works';
 }
 
+# RT #76476
+{
+    use MONKEY_TYPING;
+    class MonkeyNew { has $.x is rw };
+    augment class MonkeyNew {
+        method new() {
+            self.bless(*, :x('called'));
+        }
+    };
+    #?rakudo todo 'RT 76476'
+    is MonkeyNew.new().x, 'called', 'monkey-typed .new() method is called';
+}
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Jul 18, 2010

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

@p6rt
Copy link
Author

p6rt commented Oct 1, 2011

From @coke

On Mon Jul 12 10​:15​:55 2010, moritz wrote​:

19​:13 <@​jnthn> rakudo​: use MONKEY_TYPING; class Foo { }; augment class
Foo {
method new { say "called" } }; Foo.new
19​:13 <+p6eval> rakudo bb6df2​: ( no output )
19​:14 <@​jnthn> hmpfth
19​:14 * moritz_ submits rakudobug

This now prints​:

called

And, bonus, we have an auto-generated test message, closing ticket.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 1, 2011

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

@p6rt p6rt closed this as completed Oct 1, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant