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

Disallow top-level def super and def previous_def #10097

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

makenowjust
Copy link
Contributor

Because there is no way to call this.


Doubt. We can call such a top-level def super via a file private implicit module.

private def module_self
  self
end

def super
  p :super
end

module_self.super

But it seems like a bug because it does not compile if def module_self is public or protected.

Becasue there is no way to call this.
@makenowjust makenowjust changed the title Disallow top-level 'def super' Disallow top-level def super and def previous_def Dec 18, 2020
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
@HertzDevil
Copy link
Contributor

Can't this be done in TopLevelVisitor instead? (FunDef does a similar check there.)

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.

4 participants