junrushao commented on PR #455:
URL: https://github.com/apache/tvm-ffi/pull/455#issuecomment-3906565908
Addressed Gemini's review comments:
1. **Arity validation in constructor** (high): Added argument count
validation in the `TypeChecker` constructor for generic kinds:
- `Optional`: requires exactly 1 type argument
- `Array`/`List`: requires 0 or 1 type arguments
- `Map`: requires 0 or 2 type arguments
Malformed schemas now fail early with a clear error message via
`TVM_FFI_ICHECK`.
2. **Simplified DLTensorPtr logic** (medium): Removed the redundant inner
`if (ti == TypeIndex::kTVMFFITensor)` branch since both paths returned
`Any(src)`. The simplified code just checks `src.try_cast<DLTensor*>()` and
returns `Any(src)` on success.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]