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

Don't lookup super method on the top level #5202

Merged
merged 1 commit into from Oct 30, 2017

Conversation

lbguilherme
Copy link
Contributor

@lbguilherme lbguilherme commented Oct 28, 2017

Fixes #5201.

def bar
end

class Foo
  def bar
    super
  end
end

Foo.new.bar

I believe this code is wrong and shouldn't compile. The consequence is that it fixes #5201, where the method ends up being codegen-ed twice (I believe it tries to codegen the looked-up method because the type of self would have changed, but it doesn't make sense in this case).

This is my first commit touching the compiler itself, hoping for the best.

@RX14 RX14 added this to the Next milestone Oct 30, 2017
@asterite
Copy link
Member

@lbguilherme Congratulations on your first compiler PR! And thank you! ❤️

@RX14 RX14 merged commit 394f3f0 into crystal-lang:master Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

link time error: multiple definition of method
3 participants