Commit 8bdcc18
committed
Address review: explain why CborType | ReadonlyCborType union is needed
bartlomieju noted on #7148 that the union looks redundant at first
glance because mutable Map/array/index-signature are all assignable
to their readonly counterparts. The reason it is needed is that
CborTag<T> has a writable tagContent field and is therefore
invariant in T, so CborTag<CborType> is not assignable to
CborTag<ReadonlyCborType> and the union preserves existing CborTag
callers. Document that on ReadonlyCborType so the union is not
'simplified' away later.1 parent 8df2d62 commit 8bdcc18
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
| |||
0 commit comments