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 nominal type check fails for a parameter constraint with no supplied variable name #1909

Closed
p6rt opened this issue Jul 3, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jul 3, 2010

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

Searchable as RT76368$

@p6rt
Copy link
Author

p6rt commented Jul 3, 2010

From @masak

<masak> rakudo​: sub foo(Str) {}; foo 42
<p6eval> rakudo 7017d2​: OUTPUT«Nominal type check failed for parameter
''; expected Str but got Int in 'foo' at line 11
* masak submits rakudobug

Ok, so the un-awesome aspect of this is the "for parameter ''" part.
It should identify the parameter in some other way, perhaps by
position. The important thing is that, when the routine contains
several parameter constraints with no associated variable name, they
be distinguishable somehow.

@p6rt
Copy link
Author

p6rt commented Jul 29, 2010

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

@p6rt
Copy link
Author

p6rt commented Feb 13, 2012

From @coke

On Sat Jul 03 08​:37​:36 2010, masak wrote​:

<masak> rakudo​: sub foo(Str) {}; foo 42
<p6eval> rakudo 7017d2​: OUTPUT�Nominal type check failed for parameter
''; expected Str but got Int in 'foo' at line 11
* masak submits rakudobug

Ok, so the un-awesome aspect of this is the "for parameter ''" part.
It should identify the parameter in some other way, perhaps by
position. The important thing is that, when the routine contains
several parameter constraints with no associated variable name, they
be distinguishable somehow.

This seems sufficient awesome now​:

21​:58 < [Coke]> rakudo​: sub foo(Str) {}; foo 42
21​:58 <+p6eval> rakudo 29f5cf​: OUTPUT«===SORRY!===␤CHECK FAILED​:␤Calling 'foo'
  will never work with argument types (int) (line 1)␤
  Expected​: :(Str )␤»

Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 12, 2014

From @coke

On Sun Feb 12 18​:59​:20 2012, coke wrote​:

On Sat Jul 03 08​:37​:36 2010, masak wrote​:

<masak> rakudo​: sub foo(Str) {}; foo 42
<p6eval> rakudo 7017d2​: OUTPUT�Nominal type check failed for
parameter
''; expected Str but got Int in 'foo' at line 11
* masak submits rakudobug

Ok, so the un-awesome aspect of this is the "for parameter ''" part.
It should identify the parameter in some other way, perhaps by
position. The important thing is that, when the routine contains
several parameter constraints with no associated variable name, they
be distinguishable somehow.

This seems sufficient awesome now​:

21​:58 < [Coke]> rakudo​: sub foo(Str) {}; foo 42
21​:58 <+p6eval> rakudo 29f5cf​: OUTPUT«===SORRY!===␤CHECK
FAILED​:␤Calling 'foo'
will never work with argument types (int) (line
1)␤
Expected​: :(Str )␤»

Closable with tests.

Test added to S06-signature/errors.t

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 12, 2014

@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