fix: doPrestige return type mismatch — interface says void but returns boolean #48
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: Major
File:
src/lib/game/stores/prestigeStore.ts(lines 94-103)Problem:
doPrestigereturnsfalseon failure andtrue/undefinedon success, but thePrestigeStateinterface declares it as() => void. This is a type mismatch — TypeScript won't catch callers trying to use the return value, and the interface lies about the contract.Impact: Type safety issue. Callers who check the return value get no type support. The interface is misleading.
Fix: Update the
PrestigeStateinterface to declaredoPrestige: (id: string) => boolean.[priority: 4] BROKEN FEATURE — doPrestige return type mismatch (interface says void, returns boolean).
Starting work on #48. Reading prestigeStore.ts to fix the doPrestige return type mismatch.
Fixed. Changed the PrestigeState interface declaration from
doPrestige: (id: string) => voidtodoPrestige: (id: string) => booleanto match the actual implementation which returns false on failure and true on success.