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

Type objects are writable in Rakudo #1030

Closed
p6rt opened this issue Jun 2, 2009 · 5 comments
Closed

Type objects are writable in Rakudo #1030

p6rt opened this issue Jun 2, 2009 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jun 2, 2009

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

Searchable as RT66204$

@p6rt
Copy link
Author

p6rt commented Jun 2, 2009

From @masak

<masak> rakudo​: class Dog {}; say Dog.defined; Dog .= new; say Dog.defined
<p6eval> rakudo d396ab​: OUTPUT«0␤1␤»
<masak> o_O
<masak> you can instantiate type objects!
<pmichaud> well, technically a type object is already instantiated,
it's just not defined.
<pmichaud> you told the type object to build itself, so it did :-P
<pmichaud> I think I definitely want to do our readonly refactor soon, though.
<masak> oh, that would solve that?
<pmichaud> yes.
<pmichaud> currently we mark which objects are readonly, and refuse to
write to those. I'd like to reverse that, so that we mark the objects
that are rw, and refuse to write to anything that isn't so marked
<masak> so I don't need to submit something for this?
* masak grins
<pmichaud> you can submit it if you like -- I don't know the timeline
for that refactor yet.
* masak submits

@p6rt
Copy link
Author

p6rt commented Nov 4, 2009

From @kyleha

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

commit c580fe86e3cb3b391a413b1cffdbe3bcf266c92d
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Wed Nov 4 20​:09​:15 2009 +0000

  [t/spec] Test for RT #​66204​: NewClass .= new should die
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28984 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S12-construction/new.t b/t/spec/S12-construction/new.t
index d4c93a3..0be3f8e 100644
--- a/t/spec/S12-construction/new.t
+++ b/t/spec/S12-construction/new.t
@@ -1,7 +1,7 @@
 use v6;
 use Test;
 
-plan 12;
+plan *;
 
 class Parent {
     has $.x;
@@ -36,4 +36,15 @@ lives_ok { $o = GrandChild.new( Parent{ :x<5> }, Child{ :y(4) }) },
 is $o.y, 4, '... worked for the class Child (other order)';
 is $o.x, 5, '... worked for the class Parent (other order)';
 
+# RT #66204
+{
+    class RT66204 {}
+    ok ! RT66204.defined, 'NewClass is not .defined';
+    #?rakudo 2 todo 'RT 66204'
+    dies_ok { RT66204 .= new }, 'class asked to build itself refuses';
+    ok ! RT66204.defined, 'NewClass is still not .defined';
+}
+
+done_testing;
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Nov 4, 2009

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

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

From @moritz

problem fixed, tests pass now...

@p6rt
Copy link
Author

p6rt commented Mar 9, 2010

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

@p6rt p6rt closed this as completed Mar 9, 2010
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