Issue #5648 has been updated by Daniel Pittman.

Assignee deleted (Daniel Pittman)

----------------------------------------
Feature #5648: Puppet should emit a warning when literal string "true" or 
"false" is used in a boolean context
https://projects.puppetlabs.com/issues/5648#change-92408

* Author: Daniel Pittman
* Status: Rejected
* Priority: Low
* Assignee: 
* Category: compiler
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
In the puppet universe the strings "true" and "false" are "boolean true",
which means that there are some cases where it will be highly unintuitive.

It would be nice if puppet would emit a warning in this case:

    if "false" { ... } else { ... }
    => "warning: the string 'false' evaluates as true, did you mean false 
instead?"

However, this should not emit a warning, I strongly suspect:

    $foo = "false"
    if $foo { ... } else { ... }

That should make this detectable, but wrong, code let people know that it
won't do what they expected.  The "string literal" case is pretty much
unambiguously expecting the wrong thing, I expect, or at least super-confusing
to someone else reading it later. :)



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to