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

Passing a string that looks like an integer fails to match MAIN(Str) #3194

Closed
p6rt opened this issue Jul 24, 2013 · 7 comments
Closed

Passing a string that looks like an integer fails to match MAIN(Str) #3194

p6rt opened this issue Jul 24, 2013 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Jul 24, 2013

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

Searchable as RT119001$

@p6rt
Copy link
Author

p6rt commented Jul 24, 2013

From @hoelzro

If I define a MAIN sub with a Str parameter and pass an integer
argument, the type check fails and MAIN is never called. '10' is
technically a string, so I think it should still pass a string to MAIN.
(Example code attached)

@p6rt
Copy link
Author

p6rt commented Jul 24, 2013

From @hoelzro

use v6;

sub MAIN(Str $value) {
}

# output when I run perl6 main-str-int-argument.p6 10​:
#`(
$ perl6 main-str-int-argument.p6 10
Usage​:
  main-str-int-argument.p6 <value>
)

@p6rt
Copy link
Author

p6rt commented Sep 17, 2015

From @coke

On Wed Jul 24 01​:04​:23 2013, rob@​hoelz.ro wrote​:

If I define a MAIN sub with a Str parameter and pass an integer
argument, the type check fails and MAIN is never called. '10' is
technically a string, so I think it should still pass a string to MAIN.
(Example code attached)

This now works.

Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Sep 17, 2015

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

@p6rt
Copy link
Author

p6rt commented Sep 18, 2015

From @usev6

I added a test to S06-other/main-usage.t with commit Raku/roast@f5a77ba56d

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Sep 18, 2015

From @usev6

I added a test to S06-other/main-usage.t with commit Raku/roast@f5a77ba56d

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Sep 18, 2015

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