Navigation Menu

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

Typed undefined attributes/parameters aren't typed with the right undefined type object in Rakudo #1613

Closed
p6rt opened this issue Mar 20, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Mar 20, 2010

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

Searchable as RT73680$

@p6rt
Copy link
Author

p6rt commented Mar 20, 2010

From @masak

<bbkr> rakudo​: grammar CSV { has Str $.sep }; say CSV.new(sep => ",").sep
<p6eval> rakudo 0bb373​: OUTPUT«Any()␤»
<bbkr> hmm, why "Any()" ?
<masak> bbkr​: it's the new 'undef'
<jnthn> masak​: Yes, but shoulda been Str.
<masak> o.O
<jnthn> erm, shoulda been "," actually
<jnthn> masak​: Typed attribute.
* masak submits rakudobug
<masak> rakudo​: class A { has Str $.b }; say A.new().b.WHAT
<p6eval> rakudo 0bb373​: OUTPUT«Any()␤»

@p6rt
Copy link
Author

p6rt commented Jun 24, 2010

From @masak

On Sat Mar 20 07​:49​:13 2010, masak wrote​:

<bbkr> rakudo​: grammar CSV { has Str $.sep }; say CSV.new(sep => ",").sep
<p6eval> rakudo 0bb373​: OUTPUT«Any()␤»
<bbkr> hmm, why "Any()" ?
<masak> bbkr​: it's the new 'undef'
<jnthn> masak​: Yes, but shoulda been Str.
<masak> o.O
<jnthn> erm, shoulda been "," actually
<jnthn> masak​: Typed attribute.
* masak submits rakudobug
<masak> rakudo​: class A { has Str $.b }; say A.new().b.WHAT
<p6eval> rakudo 0bb373​: OUTPUT«Any()␤»

The same is true for typed named parameters when no argument is supplied​:

<masak> rakudo​: sub MAIN(Bool :$foo) { say $foo.WHAT }
<p6eval> rakudo 11cbd4​: OUTPUT«Any()␤»

I have a feeling there was already another RT ticket for this, but I can't find it, so using this
one for now.

@p6rt
Copy link
Author

p6rt commented Jun 24, 2010

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

@p6rt
Copy link
Author

p6rt commented Oct 21, 2011

From @coke

On Sat Mar 20 07​:49​:13 2010, masak wrote​:

<bbkr> rakudo​: grammar CSV { has Str $.sep }; say CSV.new(sep =>
",").sep
<p6eval> rakudo 0bb373​: OUTPUT«Any()␤»
<bbkr> hmm, why "Any()" ?
<masak> bbkr​: it's the new 'undef'
<jnthn> masak​: Yes, but shoulda been Str.
<masak> o.O
<jnthn> erm, shoulda been "," actually
<jnthn> masak​: Typed attribute.
* masak submits rakudobug
<masak> rakudo​: class A { has Str $.b }; say A.new().b.WHAT
<p6eval> rakudo 0bb373​: OUTPUT«Any()␤»

This seems to work now​:

15​:49 < [Coke]> rakudo​: grammar CSV { has Str $.sep }; say CSV.new(sep
=>
  ",").sep
15​:49 <+p6eval> rakudo 142c41​: OUTPUT«,␤»
15​:49 < [Coke]> rakudo​: class A { has Str $.b }; say A.new().b.WHAT
15​:49 <+p6eval> rakudo 142c41​: OUTPUT«Str()␤»

Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 25, 2011

From @moritz

Now tested in S05-grammar/methods.t

@p6rt
Copy link
Author

p6rt commented Oct 25, 2011

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