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

foo C.new: method form call tries to call foo routine if newline is present after ":" #5924

Open
p6rt opened this issue Dec 28, 2016 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 28, 2016

Migrated from rt.perl.org#130425 (status was 'open')

Searchable as RT130425$

@p6rt
Copy link
Author

p6rt commented Dec 28, 2016

From @zoffixznet

$ ./perl6 -e $'class C { method foo { say 10 } }; foo C.new​:\n'
===SORRY!=== Error while compiling -e
Undeclared routine​:
  foo used at line 1

$ ./perl6 -v
This is Rakudo version 2016.12-122-gd35efb6 built on MoarVM version 2016.12-23-g3c5253c
implementing Perl 6.c.

This also appears to happen if written in a file or typed in the REPL

@p6rt
Copy link
Author

p6rt commented Sep 28, 2017

From @skids

On Wed, 28 Dec 2016 08​:30​:34 -0800, cpan@​zoffix.com wrote​:

$ ./perl6 -e $'class C { method foo { say 10 } }; foo C.new​:\n'
===SORRY!=== Error while compiling -e
Undeclared routine​:
foo used at line 1

$ ./perl6 -v
This is Rakudo version 2016.12-122-gd35efb6 built on MoarVM version
2016.12-23-g3c5253c
implementing Perl 6.c.

This also appears to happen if written in a file or typed in the REPL

This is to spec, no? Also, did it used to do something different without
the newline? It seems to consistently look for sub foo even without it.

S12 says this​:

In case of ambiguity between indirect object notation and dot form,
the nearest thing wins​:

  dothis $obj.dothat​: 1,2,3

means

  dothis ($obj.dothat(1,2,3))

and you must say

  dothis ($obj.dothat)​: 1,2,3

or

  $obj.dothat.dothis​: 1,2,3

if you mean the other thing.

@p6rt
Copy link
Author

p6rt commented Sep 28, 2017

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

@p6rt p6rt added the parser label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant