- if (impl->decl->args) for (i = 0; i < impl->decl->args->count; ++i) {
- decl_arg *darg = impl->decl->args->args[i];
- int check = 0;
-
- for (j = 0; j < impl->stmts->let.count; ++j) {
- let_stmt *let = impl->stmts->let.list[j];
-
- if (!strcmp(let->var->name, darg->var->name)) {
- check = 1;
- break;
+ if (impl->decl->args) {
+ struct psi_decl_arg *darg;
+
+ for (i = 0; psi_plist_get(impl->decl->args, i, &darg); ++i) {
+ if (!psi_impl_get_let(impl, darg->var)) {
+ data->error(data, impl->func->token, PSI_WARNING,
+ "Missing `let` statement for arg '%s %s%s'"
+ " of declaration '%s' for implementation '%s'",
+ darg->type->name,
+ psi_t_indirection(darg->var->pointer_level),
+ darg->var->name, impl->decl->func->var->name,
+ impl->func->name);
+ return false;