Issue #11584 has been reported by Trevor Vaughan.

----------------------------------------
Bug #11584: Nested defines using higher level variables should fail to compile 
instead of throwing a scope warning.
https://projects.puppetlabs.com/issues/11584

Author: Trevor Vaughan
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.7.6
Keywords: 
Branch: 


In pre-2.6 versions of Puppet, the following code worked:

<pre>
define test1::def1 (
  $var1 = 'foo',
  $var2 = 'bar'
) {
  test2::def2 { 'test':
    var3 => $var1
  }
}

define test2::def2 (
  $var3
) {
  notify { "Var1 is $var1": }
  notify { "Var2 is $var2": }
  notify { "Var3 is $var3": }
}

test1::def1 { 'test': }
</pre>

However, Puppet >= 2.6 gives a scope warning on the $var1 and $var2 variables 
being used in test2::def2.

Since there is no way to know the calling scope from within the Puppet code, 
this should be a compile failure instead of a scope warning.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to