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

LTA error message when sending too few parameters to an only sub #1473

Closed
p6rt opened this issue Jan 14, 2010 · 7 comments
Closed

LTA error message when sending too few parameters to an only sub #1473

p6rt opened this issue Jan 14, 2010 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Jan 14, 2010

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

Searchable as RT72082$

@p6rt
Copy link
Author

p6rt commented Jan 14, 2010

From @masak

This be Rakudo db84bc, chugging along on Parrot r43174.

$ perl6 -e 'sub foo(@​a, $b) {}; foo(5)'
Nominal type check failed for parameter '@​a'; expected Positional but
got Int instead

While the nominal type check does indeed fail when sending an Int
where a Positional is expected, I'd much rather Rakudo fail me for
sending in one argument instead of two.

@p6rt
Copy link
Author

p6rt commented Oct 5, 2011

From @coke

On Thu Jan 14 07​:12​:33 2010, masak wrote​:

This be Rakudo db84bc, chugging along on Parrot r43174.

$ perl6 -e 'sub foo(@​a, $b) {}; foo(5)'
Nominal type check failed for parameter '@​a'; expected Positional but
got Int instead

While the nominal type check does indeed fail when sending an Int
where a Positional is expected, I'd much rather Rakudo fail me for
sending in one argument instead of two.

Same error message on recent-vintage rakudo.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 5, 2011

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

@p6rt
Copy link
Author

p6rt commented May 29, 2012

From @diakopter

On Tue Oct 04 17​:32​:39 2011, coke wrote​:

On Thu Jan 14 07​:12​:33 2010, masak wrote​:

This be Rakudo db84bc, chugging along on Parrot r43174.

$ perl6 -e 'sub foo(@​a, $b) {}; foo(5)'
Nominal type check failed for parameter '@​a'; expected Positional
but
got Int instead

While the nominal type check does indeed fail when sending an Int
where a Positional is expected, I'd much rather Rakudo fail me for
sending in one argument instead of two.

Same error message on recent-vintage rakudo.

DTRT now. marking testneeded, though there's probably already a test
for it.

16​:44 <p6eval> rakudo 024843​: OUTPUT«===SORRY!===␤CHECK
FAILED​:␤Calling 'foo' will never
  work with argument types (int) (line 1)␤ Expected​: :
(@​a, $b)␤»

@p6rt
Copy link
Author

p6rt commented Jun 2, 2012

From @diakopter

On Tue May 29 14​:46​:17 2012, diakopter wrote​:

On Tue Oct 04 17​:32​:39 2011, coke wrote​:

On Thu Jan 14 07​:12​:33 2010, masak wrote​:

This be Rakudo db84bc, chugging along on Parrot r43174.

$ perl6 -e 'sub foo(@​a, $b) {}; foo(5)'
Nominal type check failed for parameter '@​a'; expected Positional
but
got Int instead

While the nominal type check does indeed fail when sending an Int
where a Positional is expected, I'd much rather Rakudo fail me for
sending in one argument instead of two.

Same error message on recent-vintage rakudo.

DTRT now. marking testneeded, though there's probably already a test
for it.

16​:44 <p6eval> rakudo 024843​: OUTPUT«===SORRY!===␤CHECK
FAILED​:␤Calling 'foo' will never
work with argument types (int) (line 1)␤ Expected​:
:
(@​a, $b)␤»

that is, it at least shows the signature, which shows the missing
parameter.

@p6rt
Copy link
Author

p6rt commented Nov 14, 2012

From @coke

On Fri Jun 01 17​:41​:14 2012, diakopter wrote​:

On Tue May 29 14​:46​:17 2012, diakopter wrote​:

On Tue Oct 04 17​:32​:39 2011, coke wrote​:

On Thu Jan 14 07​:12​:33 2010, masak wrote​:

This be Rakudo db84bc, chugging along on Parrot r43174.

$ perl6 -e 'sub foo(@​a, $b) {}; foo(5)'
Nominal type check failed for parameter '@​a'; expected Positional
but
got Int instead

While the nominal type check does indeed fail when sending an Int
where a Positional is expected, I'd much rather Rakudo fail me for
sending in one argument instead of two.

Same error message on recent-vintage rakudo.

DTRT now. marking testneeded, though there's probably already a test
for it.

16​:44 <p6eval> rakudo 024843​: OUTPUT«===SORRY!===␤CHECK
FAILED​:␤Calling 'foo' will never
work with argument types (int) (line 1)␤ Expected​:
:
(@​a, $b)␤»

that is, it at least shows the signature, which shows the missing
parameter.

Test added to S06-signature/errors.t

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Nov 14, 2012

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