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

Optional typed parameters can cause type check failure when no value passed #509

Closed
p6rt opened this issue Dec 19, 2008 · 4 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Dec 19, 2008

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

Searchable as RT61528$

@p6rt
Copy link
Author

p6rt commented Dec 19, 2008

From @cspencer

When defining a subroutine such as the following​:

  sub foo (Int $x?) { say "x = $x" };

and calling it without passing in a value as in​:

  foo();

a type check error will occur​:

  Parameter type check failed in call to foo
  current instr.​: 'die' pc 14378 (src/builtins/control.pir​:188)
  called from Sub '!TYPECHECKPARAM' pc 15344 (src/builtins/guts.pir​:136)
  called from Sub 'foo' pc 134 (EVAL_13​:66)
  called from Sub '_block14' pc 59 (EVAL_13​:38)
  ...
  ...

@p6rt
Copy link
Author

p6rt commented Feb 11, 2009

From @jnthn

On Fri Dec 19 08​:49​:28 2008, cspencer wrote​:

When defining a subroutine such as the following​:

sub foo (Int $x?) { say "x = $x" };

and calling it without passing in a value as in​:

foo();

a type check error will occur​:

Parameter type check failed in call to foo
...

Fixed this in git 50a61ae.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Feb 11, 2009

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

@p6rt
Copy link
Author

p6rt commented Feb 11, 2009

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

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