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

Pull in variables defined from inherited classes for top_scope_variables check #304

Closed
rodjek opened this issue Aug 20, 2014 · 2 comments
Closed

Comments

@rodjek
Copy link
Owner

rodjek commented Aug 20, 2014

class foo {
  $a = 1
}

class bar inherits foo {
  notify { $a: }
}

Shouldn't throw an error.

@rodjek rodjek added this to the 1.1.0 milestone Aug 20, 2014
@rodjek rodjek removed this from the 1.1.0 milestone Sep 21, 2014
@rodjek
Copy link
Owner Author

rodjek commented Sep 21, 2014

Not sure what I was thinking here, this is a legit warning as the variable should be referred to as $foo::a.

@rodjek rodjek closed this as completed Sep 21, 2014
@dioni21
Copy link
Contributor

dioni21 commented Aug 7, 2015

Is it legit?

According to https://docs.puppetlabs.com/puppet/latest/reference/lang_classes.html#inheritance

"The base class becomes the parent scope of the derived class, so that the new class receives a copy of all of the base class’s variables and resource defaults."

Can we please reopen this issue, or should I open a new one?

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

No branches or pull requests

2 participants