Implement validation errors for undefined fields and type mismatches #2
+42
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements proper validation errors for undefined fields and type mismatches to fix 4 conformance test failures.
Changes
1. Enhanced Type Conversion Validation (
cel/src/functions.rs)int()function: Added comprehensive range checking for float-to-int conversiontrunc()for proper handling of floating point edge casesuint()function: Similar enhancements for unsigned integer conversion2. Improved Field Access Validation (
cel/src/objects.rs)member()function: Refactored for clearer error handlingNoSuchKeyerror for undefined fields on mapsNoSuchKeywhen attempting field access on non-map types (scalars, lists, etc.)Test Cases Addressed
NoSuchKeyerrordouble_int_min_rangenow properly validates conversion boundsTechnical Details
The key improvements focus on:
Testing
These changes address conformance test failures related to validation errors. The implementation follows CEL specification requirements for type validation and field access.
🤖 Generated with Claude Code