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

regex literals in signatures #5344

Open
p6rt opened this issue May 28, 2016 · 1 comment
Open

regex literals in signatures #5344

p6rt opened this issue May 28, 2016 · 1 comment
Labels
LTA Less Than Awesome; typically an error message that could be better RFC Request For Comments

Comments

@p6rt
Copy link

p6rt commented May 28, 2016

Migrated from rt.perl.org#128278 (status was 'new')

Searchable as RT128278$

@p6rt
Copy link
Author

p6rt commented May 28, 2016

From @LLFourn

multi regex-dispatch(/fo+/) { };
multi regex-dispatch(/ba+/) {};
regex-dispatch("foo");

Calling regex-dispatch(Str) will never work with any of these multi
signatures​:
  (Int $ where { ... })
  (Int $ where { ... })

Obviously what I meant was dispatch it to the one matching. correct answer
is to do $ where /../. A literal regex could be an alias for that like a
literal "foo" is an alias for $ where "foo". Otherwise make it a compile
time error saying you can't use a literal regex in a signature.

@p6rt p6rt added LTA Less Than Awesome; typically an error message that could be better RFC Request For Comments labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better RFC Request For Comments
Projects
None yet
Development

No branches or pull requests

1 participant