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

Can't make use of nested class declarations in Rakudo #1696

Closed
p6rt opened this issue Apr 16, 2010 · 8 comments
Closed

Can't make use of nested class declarations in Rakudo #1696

p6rt opened this issue Apr 16, 2010 · 8 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 16, 2010

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

Searchable as RT74426$

@p6rt
Copy link
Author

p6rt commented Apr 16, 2010

From @masak

<masak> rakudo​: class A { class B {} }; A​::B.new # this should work,
shouldn't it?
<p6eval> rakudo 78faa0​: OUTPUT«Can not find sub A​::B [...]
<masak> alpha​: class A { class B {} }; say A​::B.new
<p6eval> alpha 30e0ed​: OUTPUT«A​::B()<0x2b1501b2e3e0>␤»
* masak submits rakuodbug

@p6rt
Copy link
Author

p6rt commented May 30, 2010

From @masak

<pmichaud> rakudo​: package A { package C​::B { our sub c { say "OH HAI"
} } }; A​::C​::B​::c
<p6eval> rakudo 1727ca​: OUTPUT«Can not find sub A​::C​::B​::c [...]
<pmichaud> that one is wrong (afaik)
<masak> cognominal​: :)
<pmichaud> that should've printed "OH HAI"
* masak submits rakudobug
<pmichaud> rakudo​: package A { package C​::B { our sub c { say "OH HAI"
} } }; C​::B​::c
<p6eval> rakudo 1727ca​: OUTPUT«OH HAI␤»
<pmichaud> afaik, that one is wrong.

Same for other things which nest, like classes.

@p6rt
Copy link
Author

p6rt commented Jun 1, 2010

From snarkyboojum@gmail.com

On Rakudo @​ 1727ca53c7052fabe008748b70823bf8460ad656

In trying to write tests for Day 21 of the Perl 6 Advent Calendar on current Rakudo​:

class Question {
  class Answer {}
  has Question​::Answer @​.answers;
}

when run gives​:

===SORRY!===
In "has" declaration, typename Question​::Answer must be predeclared (or marked as declarative with :​: prefix) at line 5, near " @​.answers"

and the discussion on IRC​:

masak​:rakudo​: class A { class B { has A​::B $.foo } } # golfed :)
[01​:22am]p6eval​:rakudo 1727ca​: OUTPUT«===SORRY!===␤In "has" declaration, typename A​::B must be predeclared (or marked as declarative with :​: prefix) at line 11, near " $.foo } }"␤»
[01​:23am]masak​:moritz_​: don't think you're missing something. I can't explain it either.

This works on alpha.

@p6rt
Copy link
Author

p6rt commented Jun 27, 2010

From acwhite.au@googlemail.com

On Rakudo @​ 1727ca53c7052fabe008748b70823bf8460ad656

In trying to write tests for Day 21 of the Perl 6 Advent Calendar on current Rakudo​:

class Question {
  class Answer {}
  has Question​::Answer @​.answers;
}

when run gives​:

===SORRY!===
In "has" declaration, typename Question​::Answer must be predeclared (or marked as declarative with :​: prefix) at line 5, near " @​.answers"

and the discussion on IRC​:

masak​:rakudo​: class A { class B { has A​::B $.foo } } # golfed :)
[01​:22am]p6eval​:rakudo 1727ca​: OUTPUT«===SORRY!===␤In "has" declaration, typename A​::B must be predeclared (or marked as declarative with :​: prefix) at line 11, near " $.foo } }"␤»
[01​:23am]masak​:moritz_​: don't think you're missing something. I can't explain it either.

This works on alpha.

@p6rt
Copy link
Author

p6rt commented Oct 22, 2011

From @coke

On Sun May 30 08​:50​:55 2010, masak wrote​:

<pmichaud> rakudo​: package A { package C​::B { our sub c { say "OH HAI"
} } }; A​::C​::B​::c
<p6eval> rakudo 1727ca​: OUTPUT«Can not find sub A​::C​::B​::c [...]
<pmichaud> that one is wrong (afaik)
<masak> cognominal​: :)
<pmichaud> that should've printed "OH HAI"
* masak submits rakudobug
<pmichaud> rakudo​: package A { package C​::B { our sub c { say "OH HAI"
} } }; C​::B​::c
<p6eval> rakudo 1727ca​: OUTPUT«OH HAI␤»
<pmichaud> afaik, that one is wrong.

Same for other things which nest, like classes.

These all seem to work now​:

21​:45 < [Coke]> rakudo​: class A { class B {} }; A​::B.new
21​:45 <+p6eval> rakudo 142c41​: ( no output )
21​:45 < [Coke]> rakudo​: class A { class B {} }; A​::B.new.WHAT.say
21​:45 <+p6eval> rakudo 142c41​: OUTPUT«B()␤»
21​:46 < [Coke]> rakudo​: package A { package C​::B { our sub c { say "OH
HAI" } } }; A​::C​::B​::c
21​:46 <+p6eval> rakudo 142c41​: OUTPUT«OH HAI␤»
21​:46 < [Coke]> rakudo​: package A { package C​::B { our sub c { say "OH
HAI" } } }; C​::B​::c
21​:46 <+p6eval> rakudo 142c41​: OUTPUT«Could not find symbol 'C​::B​::&c'␤
in block <anon> at /tmp/PYAMo6baOl​:1␤
  in <anon> at /tmp/PYAMo6baOl​:1␤»

Closable with tests.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 22, 2011

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

@p6rt
Copy link
Author

p6rt commented Mar 30, 2012

From @moritz

We now have a few tests for that, for example in S11-modules/nested.t

@p6rt
Copy link
Author

p6rt commented Mar 30, 2012

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

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