puppetlabs/geppetto — pull request #35 by thallgren (2014-09-11 09:24:33+00:00)
Title: (GEP-108) Warn when conditional is used as r-value

A conditional expression (if, unless, case) cannot be an r-value
expression in Puppet versions < 4.0. This commit ensures that they
will be flagged with an error unless the target platform is >= 4.0.

The commit changes the inheritance hierarchy of the pp Expressions
so that if, unless, case, definition, and node are ExpressionBody
subclasses (they all have a sequence of statements). This made it
easy to check if a conditional is directly contained in a body (and
hence allowed) or if it used as an r-value. The one exception
I found to this is when a case is used in a relationship.