(op string, loc, lloc, rloc ast.Node, lhs, rhs super.Type)
| 427 | } |
| 428 | |
| 429 | func (c *checker) binary(op string, loc, lloc, rloc ast.Node, lhs, rhs super.Type) super.Type { |
| 430 | switch strings.ToLower(op) { |
| 431 | case "and", "or": |
| 432 | c.logical(lloc, rloc, lhs, rhs) |
| 433 | return super.TypeBool |
| 434 | case "in", "not in": |
| 435 | c.in(loc, lloc, rloc, lhs, rhs) |
| 436 | return super.TypeBool |
| 437 | case "==", "!=", "=", "<>": |
| 438 | return c.equality(lhs, rhs) |
| 439 | case "<", "<=", ">", ">=": |
| 440 | return c.comparison(lhs, rhs) |
| 441 | case "+": |
| 442 | return c.plus(loc, lhs, rhs) |
| 443 | case "-", "*", "/", "%": |
| 444 | return c.arithmetic(lloc, rloc, lhs, rhs) |
| 445 | default: |
| 446 | panic(op) |
| 447 | } |
| 448 | } |
| 449 | |
| 450 | func (c *checker) this(loc ast.Node, this *sem.ThisExpr, typ super.Type) super.Type { |
| 451 | for _, field := range this.Path { |
no test coverage detected