Issue #1198 has been updated by Henrik Lindberg.

Issue #4408 closed as a duplicate. It adds the idea that a 'strict' mode should 
be added to trigger validation of undefined variables.
----------------------------------------
Feature #1198: alter parser to throw an error on use of an undefined, unquoted, 
variable.
https://projects.puppetlabs.com/issues/1198#change-73410

Author: Mike Pountney
Status: Accepted
Priority: Low
Assignee: 
Category: language
Target version: 
Affected Puppet version: 0.25.4
Keywords: 
Branch: 


Currently, the parser treats the following cases as equivalent:

<pre>

file {"/tmp/testfile":
    content => $content
}

file {"/tmp/testfile":
    content => "$content"
}

</pre>

I think it would be beneficial to throw a compile error in the first case if 
$content is not defined, eg fail('Attempt to use unquoted, undefined variable 
$content'). This would sensibly catch many cases where I have:

* typo'd on variable names,  
* misjudged scoping,
* forgotten to define a variable that I am using in a defined type,
* broken a facter fact.

The second form provides a means for people to continue with the current logic 
of 'all variables are an empty string if undefined' for such things as 'if 
"$myvar"' statements.

Anyway, please feel free to tell me that this ain't gonna happen, just wanted 
to throw it out there... 



-- 
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