microsoft / microsoft/TypeScript
Symbol properties should not be exempt from excess property checks in presence of a string index signature
Aperta
@ahejlsberg ci sta già lavorando.
Dal 28/6/2021.
Breaking Change
Bug
Domain: check: Excess Property Checking
Rescheduled
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
In #44793, we found that a symbol index signature doesn't turn off excess property checks on symbols; however, a string index signature turns these excess property checks entirely.
interface A {
a?: string
b?: number
[key: string]: unknown
}
const symbolKey = Symbol('key')
const a: A = {
[symbolKey]: '123', // works!
}
It's likely that some users relied on this behavior; however, those users will be able to use symbol index signatures in TypeScript 4.4.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.