You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeFancyIdString=string&{__someTag: never};interfaceFancyIdContainer{[id: FancyIdString]: boolean;// ^^^^^^^^^^^^^// This is an *intersection* with a primitive type.}
We figured: there's no reason to disallow it.
Reasoning: as long as you don't have a unit type or a generic, this should be permitted.
Unit types - we feel like we need to figure out how those tie into properties.
Generics - we don't have an entirely coherent model for what that means.
You can also have a union, provided that they consist of "infinite" primitive types, tagged intersections.
Generalized Index Signatures
#44604
Someone asked if they'd be allowed to write
You can also have a union, provided that they consist of "infinite" primitive types, tagged intersections.
Non-union enums are technically unbounded - you can assign any
number
to them - should we allow them?How does
keyof
work on branded index signatures?How does the following work?
{ prop: number }
...right?keyof
is perfectly preserved asBrandedProp1 | BrandedProp2
Can we just omit support for branded index signatures?
Making this work with property names, and straightening out the inconsistencies mentioned above, could be tough.
Preserving Imports
#44137 (comment)
#44619
importsNotUsedAsValues: preserve-exact
as a thing that just says "don't touch the imports"importsNotUsedAsValues
is about the entire import statement.noErasingImportedNames
isolatedModules: false
, TypeScript can use information across files to determine whether it needs to drop an import.isolatedModules: true
, TypeScript will always preserve an import, and detect/error if it's going to cause runtime issues.isolatedModules
, this has (useful) behavior that doesn't exactly do what the flag says it does.isolatedModules
.Renaming
strictOptionalProperties
#44604
The text was updated successfully, but these errors were encountered: