func (suite *TypeCheckerTestSuite) TestInvalidOperandsCheckerForInvalidUnaryOperationWithInt() { exampleExpr := expr.NewNeg(expr.NewBoolLiteral(true)) suite.testThatNumberOfErrorsOfPassedTypeArePresentForExpr(exampleExpr, errors.OperandWithUnexpectedTypeError{}, 1) }
func NewNegNode(value attrib, sourcePosInfo attrib) (interfaces.Expr, error) { expr := expr.NewNeg(value.(interfaces.Expr)) expr.SetSourceInfo(sourcePosInfo.(token.Pos)) return expr, nil }