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

[WIP] Not to expend default new for non-class #3889

Closed

Conversation

david50407
Copy link
Contributor

Fixed #3885 .

Now will throw the correct message of executing SomeModule.new:

module Foo
  def initialize; end
end

Foo.new # undefined method 'new' for Foo:Module

If any type has `initialize` method, that compiler will auto-generate
`new` method on its metaclass, but this should not be done on non-class
types.
@david50407 david50407 changed the title Not to expend default new for non-class [WIP] Not to expend default new for non-class Jan 13, 2017
@david50407
Copy link
Contributor Author

I'm going to skip these auto-generated new methods when looking up def on modules rather than remove auto-expanded new in modules and give them back in classes which includes them.

@asterite
Copy link
Member

@david50407 The build is failing. The fix isn't good, because modules can have initialize methods that are used in including classes. That's why the build fails: LLVM::Function includes LLVM::ValueMethods which defines an initialize, and this PR breaks this.

@miketheman
Copy link
Contributor

#codetriage
This looks like it's stalled with feedback to @david50407 on why the build is failing.
Is there a better approach to take for solving this with the feedback @asterite has provided?

@asterite
Copy link
Member

Closing because it doesn't work and it's too old now.

@asterite asterite closed this Sep 29, 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.

None yet

4 participants