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

No error on assigning a type object to a :D-constrained container in Rakudo #2518

Closed
p6rt opened this issue Oct 16, 2011 · 9 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Oct 16, 2011

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

Searchable as RT101448$

@p6rt
Copy link
Author

p6rt commented Oct 16, 2011

From @masak

<masak> masak's first rule of repeated community volunteer
contribution​: "Task needs be well-defined, atomic, and result in
instant gratification on completion."
<moritz> nom​: my Int​:D $x; say $x
<p6eval> nom 25af2d​: OUTPUT«Int()␤»
<moritz> nom​: my Int​:D $x; $x = Int; say $x
<p6eval> nom 25af2d​: OUTPUT«Int()␤»
<moritz> masak​: wanna submit rakudobug? :-)
* masak submits rakudobug
<masak> whee! \o/

Observed​: type object settles in nicely in container which only
accepts defined values. Expected​: error on assignment.

@p6rt
Copy link
Author

p6rt commented Oct 5, 2015

From @FROGGS

Patch​: rakudo/rakudo@8dd74406e6

Tagging testneeded.

@p6rt
Copy link
Author

p6rt commented Oct 5, 2015

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

@p6rt
Copy link
Author

p6rt commented Oct 5, 2015

From @FROGGS

jnthn​: I think we want to do it at MOP level in the future, if nothing else for speed.
jnthn​: I think we should force an initializer on :D'd things. .new is a bad default. Try this​: `class C { has $.x = rand }; for ^5 { my C​:D $foo; say $foo.x }`
jnthn​: also we totally drop the thing on the floor in some situations, like `my $x = Int​:D; say $x`
jnthn​: That latter one is why I was more pondering a MOP-level solution​: so they are first class.
FROGGS​: do we want to keep my patch in until then?
jnthn​: I'm content with keeping it in, but please log the above somewhere in RT
jnthn​: Oh, one more problem
jnthn​: m​: my Int​:omg $x
camelia​: rakudo-moar 8dd744​: OUTPUT«===SORRY!===␤Unsupported type smiley 'omg' used in type name␤»
jnthn​: That just nqp​::die's instead of $/.CURSOR.panic, so we get no source position :(

@p6rt
Copy link
Author

p6rt commented Oct 6, 2015

From @FROGGS

This fixes reporting the file and line number​:
rakudo/rakudo@164953b3de

@p6rt
Copy link
Author

p6rt commented Oct 7, 2015

From @FROGGS

We now require an initializer​:
rakudo/rakudo@7f0e6a56ae

Tagging testneeded.

@p6rt
Copy link
Author

p6rt commented Oct 7, 2015

From @FROGGS

Added tests​:
Raku/roast@fca109de6c
Raku/roast@6e66b7a18d

Closing ticket.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 7, 2015

From @FROGGS

Added tests​:
Raku/roast@fca109de6c
Raku/roast@6e66b7a18d

Closing ticket.

@p6rt p6rt closed this as completed Oct 7, 2015
@p6rt
Copy link
Author

p6rt commented Oct 7, 2015

@FROGGS - 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