When Less code contains a mistake, most errors produce a message that includes an attribution to which Less input file and line number the mistake happened on.
When an operation like plus, minus, or multiply is done in Less code, and one of the values is not a number ("dimension") or color, we throw error "Operation on an invalid type", but this lacks attribution to help developers find the problem.
Example
@foo: 'hello'; @bar: 'world'; div { content: @foo * @bar; }
PHP Fatal error: Uncaught Less_Exception_Compiler: Operation on an invalid type in /less.php/lib/Less/Tree/Operation.php:42 Stack trace: #0 /less.php/lib/Less/Tree/Expression.php(45): Less_Tree_Operation->compile(Object(Less_Environment)) #1 /less.php/lib/Less/Tree/Value.php(24): Less_Tree_Expression->compile(Object(Less_Environment)) #2 /less.php/lib/Less/Tree/Rule.php(82): Less_Tree_Value->compile(Object(Less_Environment))
Compare that to:
div { content: @bar; }
PHP Fatal error: Uncaught Less_Exception_Compiler: variable @bar is undefined in file test.less on line 2, column 12 1| div { 2| content: @bar; 3| } 4| in /less.php/lib/Less/Tree/Variable.php:52 Stack trace: #0 /less.php/lib/Less/Tree/Expression.php(45): Less_Tree_Variable->compile(Object(Less_Environment)) #1 /less.php/lib/Less/Tree/Value.php(24): Less_Tree_Expression->compile(Object(Less_Environment)) #2 /less.php/lib/Less/Tree/Rule.php(82): Less_Tree_Value->compile(Object(Less_Environment))
Imported from https://github.com/wikimedia/less.php/issues/84: