microsoft / microsoft/TypeScript

Spread with enum index key, invalid members don't trigger errors

Offen
#32,236 5 Kommentare 7 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@ahejlsberg arbeitet bereits daran.

Seit 03.7.2019.

Needs Investigation
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.4k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

TypeScript Version: 3.5.1

Search Terms:
object spread enum index missing keys

Code
Playground link has code

Expected behavior:
Missing keys & incorrect value types when I build a nested object using the spread operator with index keys, ought to throw errors for invalid types

Actual behavior:
It seems like the child object can have whatever shape I want, the types aren't being checked at all

Playground Link: This is same as above playground link

Related Issues: I'm not really sure what the root limitation that's causing this is so it's hard for me to find similar issues.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.