* Consolidated extra property check with intersections
* Fix comment
* Add tests
* Properly propagate intersectionState
* Route property check through recursive type tracking logic
* Accept new baselines
* Skip check when apparent type of source is never
* Accept new baselines
* Only check when apparent type of source is a structured type
* Elaborate on reasons for 'never' intersections
* Accept new API baselines
* Accept new baselines
* Add tests
* Accept new baselines
* Address CR feedback
* Explicitly merge module augmentation members into the exports added by export * declarations
* Use ?., add namespace merge test
* Add missing merged symbol call to handle enum/ns merges during entity name lookup
* Add test with error case
* Handle missing value declarations in more places, unify duplicate declaration error handling to improve assignment declaration duplicate errors
* Fix crash on bad namespace parse
`global` inside a class body is parsed as a module declaration, and in
the following example has no body:
```ts
class C {
global x
}
```
`x` is parsed as a separate ExpressionStatement. This caused a crash in
emit because the code didn't expect a module declaration with no body.
* inline node.body variable
* fix missed references to body
* Make never rest type top-like
* Add higher-order test
* properly support types which reduce to never
Co-authored-by: Wesley Wigham <wwigham@gmail.com>
* New diagnostic message for wrong JSX function component
* Component and Mixed type
* fix existing tests
* add new test for JSX component return type error
* fix tslint error
* update diagnostic message to include component name
* accept baseline
* update tests
* missing semicolon
* accept baseline
Co-authored-by: Wesley Wigham <wwigham@gmail.com>
* 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>
* Improve jsx tag error span
* Move solution to parseJsxChild func
* Add tests and update baselines
* Update comment in src/compiler/parser.ts
Co-Authored-By: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Use skipTrivia to check for whitespaces and other trivia
* Import React into errorSpanForUnclosedJsxTag.tsx
* .
* .
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Flatten immediately nested conditional types in the false position
* Add test
* Accept new baselines
* Handle nested distributive types with different checkType
* Allow deeply nested immediately resolving conditionals without any syntactic requirements or implementation contortions
Extract logic into function
Co-authored-by: Wesley Wigham <wewigham@microsoft.com>
* Treat intersections of only objects as a single object in relations
* Exclude intersections containing non-inferrable types
* Accept new baselines
* Update test
* Accept new baselines
* Add tests
* Make substitution types even if the substitution base isnt a type variable
* Broaden usage of getConditionalFlowTypeOfType to _all_ type lookups
* Align comments
* Treat write-only-access to a class member with setter as a reference.
* Add test case for unused private members, special-casing the member with a setter.
* make splice `deleteCount` required in es5.d.ts
In ES5 `deleteCount` is not an optional argument. If it is not provided it defaults to 0 as a side effect of `undefined` being converted to an integer.
In ES6 `deleleteCount` is optional, and it defaults to the length of the array minus the start index.
If you are targeting ES5 but don't provide `deleteCount` the behaviour will be different depending on the environment your build is running in.
fixes#32638
* update baselines
* Implement constructor type guard
* Fix code review issues for constructor type guard.
- Do not limit constructor expression to only identifiers
- Fix `assumeTrue` and operator no-narrow check
- Use better way to check that identifier type is a function
- Loosen restriction on what expr is left of ".constructor"
- Update typeGuardConstructorClassAndNumber test to include else cases
* Fix grammar & spacing in `narrowTypeByConstructor`
* fix bad merge
* switch (back?) to crlf
* update baselines
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>