Skip to content

Why does logic test case error_right and error_left expect a “no matching overload” error? #475

@chobie

Description

@chobie

I'm currently investigating the logic conformance tests. Among them, the test case for error_right includes the expression:

true && 1/0 != 0

It appears that the expected error for this case is:

test {
  name: "error_right"
  expr: "true && 1/0 != 0"
  eval_error: {
    errors: { message: "no matching overload" }
  }
}

Source: logic.textproto#L86

From my understanding, the expression 1/0 would raise a division by zero error, which should be propagated first.
So I don't quite understand why a no matching overload error is expected instead.

When I tried executing a similar expression using cel-go (v0.25.0), it returned a division by zero error.

How should I interpret this conformance test case?


package main

import (
    "fmt"
    "log"

    "github.com/google/cel-go/cel"
)

func main() {
    env, err := cel.NewEnv()
    if err != nil {
        log.Fatalf("error: %v", err)
    }
    ast, iss := env.Compile(`true && 1/0 != 0`)
    if iss.Err() != nil {
        log.Fatalf("compile error: %v", iss.Err())
    }
    prg, err := env.Program(ast)
    if err != nil {
        log.Fatalf("program error: %v", err)
    }
    out, _, err := prg.Eval(map[string]interface{}{})
    if err != nil {
        log.Fatalf("runtime error: %v", err)
    }
    fmt.Println(out)
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions