Commit 7fb5b14
Add pitfall: CommerceItem.categories is write-once (constructor only)
CommerceItem.categories can only be set through the constructor; assigning
it afterward (natural to write via Kotlin .apply { }) compiles cleanly but
throws at runtime on the first real purchase. A build-time check won't catch
it, so it surfaces as a device crash inside the app's own trackPurchase
wrapper — exactly the silent-until-runtime trap the skill exists to flag.
Adds PITFALLS #21 with the correct constructor-arg form and a general rule
to construct CommerceItem fully rather than mutate write-once fields after.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 2fad726 commit 7fb5b14
1 file changed
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
0 commit comments