Skip to content

Commit fc9acb3

Browse files
authored
Correct example code (#228)
* Correct example Typo we didn't catch, just fixing it. (Bob found it in Slack.) * Typo
1 parent 19c21db commit fc9acb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/_posts/2025-08-05-compile-generics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class Articles extends Sequence<Article> {}
213213

214214
class Library extends Set<Book> {}
215215

216-
class YearBooks<int, Book> {}
216+
class YearBooks extends Dict<int, Book> {}
217217
```
218218

219219
Those concrete classes could have additional methods in them if desired, but that's optional. The above would be sufficient to have a collection that mapped integers to Book objects, and had syntax-level guarantees those types would hold.

0 commit comments

Comments
 (0)