Skip to content

Document that @name is a method call if self.name is a function #436

Description

@bpj

Please consider these three expressions:

  1. @\foo bar, @baz
  2. @foo bar, @baz
  3. @.foo bar, @baz

Currently 1 and 2 both compile into

self:foo(bar, self.baz)

while 3 compiles into

self.foo(bar, self.baz)

with 2 interpreted as a method call, which I find rather confusing. I did rather expect 2 to be interpreted like 3, especially since non-calling context @baz compiles to self.baz in all cases!

I'm not sure that this is a bug (I have not found it in the documentation) but it seems inconsistent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions