Since `resultTy` might be nullptr, we should use `dyn_cast` instead of `cast`. Additionally, `typeConverter->convertType<T>` is more appropriate in this context.
Multi-Level Intermediate Representation
See https://mlir.llvm.org/ for more information.