* Add the 'awaited' type operator
* Add script to manually add reviewers to a PR when GH 'Suggested Reviewers' breaks
* Fix lint error in review script
* Only defer generic awaited type for possible thenable
* Add variance-like behavior for awaited
* Switch awaited type params to 'unreliable' variance
* fix typo in inferTypes
* LKG without syntax in lib
* LKG with new syntax in lib
* Add 'strictAwaitedTypes' flag
* Treat strictAwaitedTypes as strict-mode flag
* Rename TAll, remove duplicate definition of 'race'
* Apply suggestions from code review
Co-Authored-By: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
* Fix inference priority
* Update comment to isGenericAwaitableType
* Add overloads for then/catch to Promise
* Add inference heuristic for T | PromiseLike<T> (for any PromiseLike)
* Remove strictAwaitedTypes flag
Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
* More precise property-overwritten-by-spread errors
Trying to do this check in getSpreadType just doesn't have enough
information, so I moved it to checkObjectLiteral, which is a better
place for issuing errors anyway.
Unfortunately, the approach is kind of expensive in that it
1. creates a new map for each property and
2. iterates over all properties of the spread type, even if it's a
union.
I have some ideas to improve (1) that might work out. I'm not sure how
bad (2) is since we're going to iterate over all properties of all
constituents of a union.
Fixes#36779
* another test and rename
* Treat never-like intersections as never
* Accept new baselines
* Fix compiler issues revealed by increased intersection correctness
* Delete fourslash tests that are no longer applicable
* Include isNeverLikeIntersection check in getNormalizedType
* Erase never-like types in several more places
* Check that base types are not never-like
* Add comments
* Revert isNeverLikeType check in getIndexType (keyof shouldn't resolve member types)
* Introduce getReducedType for union and intersection types
* Don't reduce in getApparentType
* Avoid relationship check in resolveMappedTypeMembers
* Accept new baselines
* Don't call getReducedType in getIndexType
* Ensure reduced and unreduced forms of a type can compare identical
* Reduce types before converting them to string representation
* Accept new baselines
* Reduce intersections before obtaining keyof X
* Add tests
* Accept new baselines
* Fix comment in tests
* Don't infer from empty intersection types
* Add tests
* Accept new baselines
* Defer instantiation of mapped type property types
* Accept new baselines
* Include more precise type in diagnostic
* Accept new baselines
* Minor optimization
* Improve error message
* Optional properties in intersections are never discriminants
* add tests but not baselines or fixes
* Update original change
Still probably wrong; probably doesn't even compile beacuse I'm just
typing on my laptop.
* fix error code ok
* notes to self
* Error: property is specified more than once via spread
* make jsx tests stricter
* update semicolon error message
* use ?. because it is great
* use maybeTypeOfKind in new code
* restore jsx error
* add tests
* Check combined intersection properties against target index signatures
* Add tests
* Accept new baselines
* Less aggressive check for index signatures
* Track intersection membership state for both source and target
* Minor fixes
* Binding element initializers contextually typed by parent initializers
* Accept new baselines
* Literal type widening should be last step in inference
* Accept new baselines
* Add tests
* Increase selectivity of subtype relationship for signatures
* Add regression test
* Accept new baselines
* Use strictSubtypeRelation for union subtype reduction
* (x: number | undefined) -> void is subtype of (x?: number | undefined) => void
* Accept new baselines
* Add tests
* Accept new baselines
* Address CR feedback
* Fix parameter list length check
* Accept API baseline changes
* When calculating spreads, merge empty object into nonempty object to produce partial object to reduce complexity
* Actually accept remainder of baselines
* Limit simplification to single prop or partial types
* Add inference priority level for conditional types in contravariant positions
* Accept new API baselines
* Add regression tests
* Accept new baselines
* Add isIntersectionConstituent to relation key
isIntersectionConstituent controls whether relation checking performs
excess property and common property checks. It is possible to fail a
relation check with excess property checks turned on, cache the result,
and then skip a relation check with excess property checks that would
have succeeded. #33133 provides an example of such a program.
Fixes#33133 the right way, so I reverted the fix at #33213Fixes#34762 (by reverting #33213)
Fixes#33944 -- I added the test from #34646
* Update comments in test