Commit graph

16 commits

Author SHA1 Message Date
Anders Hejlsberg 643351ca2d Support deferred resolution of type arguments in type references 2019-08-23 09:54:55 -04:00
Anders Hejlsberg 1fd1de9625 More simplification + consistent use of getConstraintOfTypeParameter 2018-07-24 15:27:39 -07:00
Andy 8a3090bc35
Improve test for 'symbol.exports' (#25523)
* Improve test for 'symbol.exports'

* Remove SymbolFlags.HasExports and SymbolFlags.HasMembers

* Update baseline
2018-07-11 09:37:32 -07:00
Andy e53e56cf82
Enable '--strictNullChecks' (#22088)
* Enable '--strictNullChecks'

* Fix API baselines

* Make sys.getEnvironmentVariable non-nullable

* make properties optional instead of using `| undefined` in thier type

* reportDiagnostics should be required

* Declare firstAccessor as non-nullable

* Make `some` a type guard

* Fix `getEnvironmentVariable` definition in tests

* Pretend transformFlags are always defined

* Fix one more use of sys.getEnvironmentVariable

* `requiredResponse` accepts undefined, remove assertions

* Mark optional properties as optional instead of using `| undefined`

* Mark optional properties as optional instead of using ` | undefined`

* Remove unnecessary null assertions

* Put the bang on the declaration instead of every use

* Make `createMapFromTemplate` require a parameter

* Mark `EmitResult.emittedFiles` and `EmitResult.sourceMaps` as optional

* Plumb through undefined in emitLsit and EmitExpressionList

* `ElementAccessExpression.argumentExpression` can not be `undefined`

* Add overloads for `writeTokenText`

* Make `shouldWriteSeparatingLineTerminator` argument non-nullable

* Make `synthesizedNodeStartsOnNewLine` argument required

* `PropertyAssignment.initializer` cannot be undefined

* Use one `!` at declaration site instead of on every use site

* Capture host in a constant and avoid null assertions

* Remove few more unused assertions

* Update baselines

* Use parameter defaults

* Update baselines

* Fix lint

* Make Symbol#valueDeclaration and Symbol#declarations non-optional to reduce assertions

* Make Node#symbol and Type#symbol non-optional to reduce assertions

* Make `flags` non-nullable to reduce assertions

* Convert some asserts to type guards

* Make `isNonLocalAlias` a type guard

* Add overload for `getSymbolOfNode` for `Declaration`

* Some more `getSymbolOfNode` changes

* Push undefined suppression into `typeToTypeNodeHelper`

* `NodeBuilderContext.tracker` is never `undefined`

* use `Debug.assertDefined`

* Remove unnecessary tag

* Mark `LiteralType.freshType` and `LiteralTupe.regularType` as required
2018-05-22 14:46:57 -07:00
Andy 8153397e91
Lazily compute signature type predicates (#17600)
* Lazily compute signature type predicates

* Use an instance of IdentifierTypePredicate to represent an unresolved type predicate

* Simplify `getMaybeTypePredicate`

* Invert representation of `resolvedTypePredicate`

* Remove `__unresolvedTypePredicate` type and remember to use `noTypePredicate` instead of `undefined` when in all `createSignature` calls

* Fix style of getTypePredicateOfSignature

* Use in createGetSymbolWalker

* Fix bugs for unions of type predicates

* Code review

* Make noTypePredicate purely an implementation detail of getTypePredictateOfSignature

* Add test

* Add test for #19642

* Add test with reversed order
2017-12-05 08:32:34 -08:00
Andy 74cbb827f9 Fix lint (#19387) 2017-10-20 14:12:24 -07:00
Andy 38905f46ce Minor cleanup to symbolWalker (#18549)
* Minor cleanup to symbolWalker

* Undo inlining
2017-09-22 14:07:07 -07:00
Andrew Casey 89447748d5 Reuse exiting getFirstIdentifier function 2017-08-22 11:33:36 -07:00
Andrew Casey e02da343db Retrieve type parameter constraint using getConstraintFromTypeParameter 2017-08-22 11:33:35 -07:00
Andrew Casey 1a20b6a7c3 Add support for walking IndexTypes, IndexedAccessTypes, and MappedTypes. 2017-08-22 11:33:35 -07:00
Andrew Casey d7ace2086f Fix copy-paste error 2017-08-22 11:33:34 -07:00
Andrew Casey 8cbf42cff5 Fix lint errors 2017-08-22 11:33:34 -07:00
Andrew Casey f2eacc6395 Use Maps to store visited types and symbols 2017-08-22 11:33:33 -07:00
Andrew Casey 801c1f70a2 Reshape SymbolWalker API
1. Expose visited types and symbols
2. Automatically reset before each walk
2017-08-22 11:33:32 -07:00
Wesley Wigham 2c8a5c40b8 Make SymbolWalker internal
...until required by an external consumer.
2017-08-22 11:33:32 -07:00
Wesley Wigham 053b915061 Rebase SymbolWalker change onto master
From PR #9847.
2017-08-22 11:33:32 -07:00