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

Rakudo shouldn't die on unrecognized initializers to constructors #503

Closed
p6rt opened this issue Dec 18, 2008 · 6 comments
Closed

Rakudo shouldn't die on unrecognized initializers to constructors #503

p6rt opened this issue Dec 18, 2008 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Dec 18, 2008

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

Searchable as RT61480$

@p6rt
Copy link
Author

p6rt commented Dec 18, 2008

From @masak

<masak> rakudo​: class Base { has $.foo }; class Deriving is Base {};
say Deriving.new( :foo(5) ).foo()
<p6eval> rakudo 34068​: OUTPUT[You passed an initialization parameter
that does not have a matching attribute. [...]
<TimToady> and in general, it's not an error to pass unrecognized initializers
<masak> TimToady​: oh!
<TimToady> since each class will assume it was intended for a different class
<masak> _two_ rakudobugs. :)
* masak files
<TimToady> and we want to allow scope for people splitting classes
without having to redo initializers
<TimToady> refactoring++

@p6rt
Copy link
Author

p6rt commented Jan 29, 2009

From @moritz

On Thu Dec 18 09​:52​:52 2008, masak wrote​:

<masak> rakudo​: class Base { has $.foo }; class Deriving is Base {};
say Deriving.new( :foo(5) ).foo()
<p6eval> rakudo 34068​: OUTPUT[You passed an initialization parameter
that does not have a matching attribute. [...]
<TimToady> and in general, it's not an error to pass unrecognized
initializers
<masak> TimToady​: oh!
<TimToady> since each class will assume it was intended for a
different class
<masak> _two_ rakudobugs. :)
* masak files
<TimToady> and we want to allow scope for people splitting classes
without having to redo initializers
<TimToady> refactoring++

Note that in general methods should ignore additional named argumets
http://irclog.perlgeek.de/perl6/2009-01-28#i_870566

Moritz

@p6rt
Copy link
Author

p6rt commented Jan 29, 2009

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

@p6rt
Copy link
Author

p6rt commented Feb 14, 2009

From @bacek

On Thu Dec 18 09​:52​:52 2008, masak wrote​:

<masak> rakudo​: class Base { has $.foo }; class Deriving is Base {};
say Deriving.new( :foo(5) ).foo()
<p6eval> rakudo 34068​: OUTPUT[You passed an initialization parameter
that does not have a matching attribute. [...]
<TimToady> and in general, it's not an error to pass unrecognized
initializers
<masak> TimToady​: oh!
<TimToady> since each class will assume it was intended for a
different class
<masak> _two_ rakudobugs. :)
* masak files
<TimToady> and we want to allow scope for people splitting classes
without having to redo initializers
<TimToady> refactoring++

It works in recent rakudo​:
$ ../../parrot perl6.pbc -e 'class Base { has $.foo }; class Deriving is
Base {}; say Deriving.new( :foo(5) ).foo()'
5

So ticket can be closed.

--
Bacek

@p6rt
Copy link
Author

p6rt commented Feb 14, 2009

From @masak

Indeed. Closing.

@p6rt
Copy link
Author

p6rt commented Feb 14, 2009

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

@p6rt p6rt closed this as completed Feb 14, 2009
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