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

Fixes #3547; as call with implicit receiver when invoked as a parameter to a method call #3673

Merged
merged 1 commit into from Dec 12, 2016

Conversation

dylandrop
Copy link
Contributor

@dylandrop dylandrop commented Dec 11, 2016

Fixes #3547.

This code:

class Foo
  def bar
    print as Foo
  end
end
Foo.new.bar

will now print the instance of Foo, instead of raising an unexpected token error.

I'm not sure what the implications of this is on a higher level, as this is my first PR against Crystal. It seems like this check is perhaps legacy -- by fact of this conditional check singling out as, it makes a clear break from the behavior of as?. It also looks like this check has been in here quite a while. Let me know what you think.

cc @asterite

@asterite
Copy link
Member

Looks good, thanks!

@asterite asterite merged commit 898a7ee into crystal-lang:master Dec 12, 2016
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

Successfully merging this pull request may close these issues.

None yet

2 participants