Describe the bug
When using ext.NativeTypes together with proto-mapped or manually mapped types as fields, it will try to map them as native types ignoring the fact they implement ref.Val and already exist in type provider.
To Reproduce
Check which components this affects:
Sample expression and input that reproduces the issue:
ip("127.0.0.1") == conn.addr
Test setup:
package xfiles
import "k8s.io/apiserver/pkg/cel/library"
type Conn struct {
Addr library.IP `cel:"addr"`
}
...
env, err := NewEnv(
library.IP(),
ext.NativeTypes(
ext.ParseStructTag("cel"),
reflect.TypeFor[*Conn](),
),
)
When you execute an expression, CEL will complain about missing overload for library.IP.
Expected behavior
conn.addr gets resolved into net.IP (i.e. library.IPType) and expression works as expected.
Additional context
Add any other context about the problem here.
Describe the bug
When using
ext.NativeTypestogether with proto-mapped or manually mapped types as fields, it will try to map them as native types ignoring the fact they implementref.Valand already exist in type provider.To Reproduce
Check which components this affects:
Sample expression and input that reproduces the issue:
Test setup:
When you execute an expression, CEL will complain about missing overload for
library.IP.Expected behavior
conn.addrgets resolved intonet.IP(i.e.library.IPType) and expression works as expected.Additional context
Add any other context about the problem here.