cloudsmith/geppetto — Issue #240: validate arithmetic operations
Author: hlindberg
Created: 2011-11-17 23:46:48+00:00
State: open
Labels: enhancement, validator

Arithmetic operations + - * / << and >> only operate on numeric information. A runtime error occurs if applied to something that is not a number.

Since puppet is untyped (or in fact mono-typed to string) this is naturally difficult to validate correctly, but it is at least possible to detect errors where one of the operands is static (or the result of a static operation).

For newcomers to the puppet language this is probably of value as "+" in many languages can be used for string concatenation (but no so in puppet).

An advanced implementation could take this a step further and also follow variable references to statically initialized variables.