* Revise and simplify CFA for `typeof` check expressions
* Accept new baselines
* Add regression test
* Slight change to preserve type when related in both directions
* Add regression test
* Explain reasons for exact sequence of type checks
* Use fixed time for vfs so baselining is consistent
* Baseline buildinfos
* Write new file text in baseline even if the file wasnt read on the shadow
* Remove unnecessary debugger statement
* Make sure that incremental correctness is checked with correct writeFile so we know buildInfo was written
Also baseline these so its easy to verify the changes
* More baselines for the tsbuildinfo
* If we are writing dts file and have used file text as version, we can update the signature when doing actual emit
* Make WriteFileCallback Api ready for future
* Assert that there is only single source file when emitting d.ts file
* Add test
* Renames
* More refactoring
* If we are updating dts of any of the file and it affects global scope, everything needs update in signature and dts emit
Fixes#42769
* Stacktrace optimization for getModified time in anticipation of using it more than fileExists wherever possible
* Baseline getModifiedTime, setModifiedTime, fileExits and directoryExits for experiment
* Remove unnecessary write file finger print code since its not used at all
* Use modified time instead of file existence check
* Remove unnecessary getModifiedTime
* No need to check for file existence before reading the d.ts file
* Do project reference errors before doing input/output file checks
* Dont call getModifiedTimes if dts change
* Passdown modified time if queried
* Use modified time passed through the file watching in tsbuild
* Handle force build as separate upto date status
* uptodate status worker to read buildinfo and use it to determine upto date ness
* No need to update output timestamps if buildinfo will determine uptodateness
* Store change file set instead of hasPendingChange to be able to reuse the information
* Add test that shows input file is not present
* No need to check input time stamp before buildinfo
* Keep buildinfos for lifetime of the solution builder and project
* Store modified time along with text of buildinfo
* Non composite projects dont need to track declaration change time
* Pass through buildInfo so we dont have to parse it back
* Save dts change time in buildinfo itself
* Store dts time for --out in the buildInfo
* Store hash of text in the bundle info so it can be verified before manipulating text for fast updates during prepend
This helps when text changes during incremental build toggling and we determine we can just manipulate text
* Since buildinfo is cached no need to maintain version check state
* Store output time stamps for non incremental builds
* Revert "Baseline getModifiedTime, setModifiedTime, fileExits and directoryExits for experiment"
This reverts commit 7e65cd3315ccf387f6d7e7c40263e85bcc3c961c.
* Change verbose messages for upto date status
* Reconcile reusable builder state and builder state so there are not two different types that are almost similar looking
* Cleanup impliedFormat
* Cleanup
* Cleanup noEmit option
* BuildInfo options emit as a flag
* Factor out types for program written in buildinfo with and without bundle emit
* No need to store output file stamps if not in watch mode
* Cleanup
* Test for single watch per file
* Fix emit and error update baselines that were duplicate
* More refactoring
* Only copy emit state fields when backing up to restore if emit fails
* Instead of maintaining delta of changes, maintain old state for those changes
* Add test to verify build when input file does not change
* If version of the input file does not change, dont mark as out of date
* Disable lint warning as build fails without the assert
* Report aggregate statistics for solution as well as some solution perf numbers
* Options solutionDiagnostics instead so that its not too verbose when printing diagnostics
* When tsc --build --clean, only remove tsbuildinfo if its incremental build
* Revert "Options solutionDiagnostics instead so that its not too verbose when printing diagnostics"
This reverts commit 0cf9e301038267bc1d9439c15d279940809b0c00.
* Revert "Report aggregate statistics for solution as well as some solution perf numbers"
This reverts commit 405d8e91978708a613fe8cb631a83b13c430a808.
* Revert "When tsc --build --clean, only remove tsbuildinfo if its incremental build"
This reverts commit e4e66726098201f38f5e8908a538e7a506f15efd.
* Comments in the code
* Feedback
* fix(49223): handle ExpressionWithTypeArguments nodes in isExpressionNode
* Update src/compiler/utilities.ts
* Just use `!isHeritageClause(node.parent)`.
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Remove undefined from source type of destructuring assignment with renaming
* add a test
* add test case from original issue
* add test with undefined default value
* add more test cases with const declaration
* changed error message for interface extending primitive type
* moved interface check to different function
* changed part of interface declaration to is extended by interface
Co-authored-by: harsheetkakar <harsheetkakar@bitbucket.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* remove too-late fix
* Allow any property from a mapped type
* turn off error for any non-class base
* Also handle synthetic properties more laxly
Originally from #42635, but this version is simpler.
* update baselines
* Update baselines
* createUnionProperty of accessors creates an accessor
Seems simple and doesn't break much. I need to double-check the few test
failures, however.
* Fix computation of write type of accessors
* Calculate property-vs-accessor in existing loop
Instead of looping over the props list 3 more times.
* Undo synthetic accessor change
* Minimise diff
* fix RHS of for..of loop not evaluated when LHS is array binding element with OmittedExpression
* expand widened type check
* add more test cases
* update code with suggestions
* Make test target es2015
Co-authored-by: Andrew Branch <andrew@wheream.io>
* Improve reduction of intersection types
* Accept new baselines
* Improve CFA for truthy, equality, and typeof checks
* Accept new baselines
* Remove special case for Function type
* Don't reduce intersections of form {...} & object
* Accept new baselines
* Anything is assignable to unknown-like union
* Accept new baselines
* Tweak subtype check
* Recombine unknown type from unknown-like union in more cases
* Display union origin only if it is shorter than union itself
* Accept new baselines
* Add tests
* Only attach origin type when it is shorter than union itself
* Specially preserve string & {}, number & {}, bigint & {}
* Accept new baselines
* Add additional tests
* Fix getNormalizedType and getNarrowableTypeForReference for intersections
* Switch NonNullable<T> to use T & {}
* Accept new baselines
* Use NonNullable<T> in place of anonymous T & {}
* Accept new baselines
* Add fourslash test
* More fourslash tests
* Fix getFalsyFlags handling of intersections
* Accept new baselines
* Add constraint to compareProperties type parameter
* Unconstrained type parameter not assignable to {} with strictNullChecks
* Accept new baselines
* More specific inference for constrained 'infer' types in template literal types
* PR feedback
* Add inference priority for template type placeholders
* Infer to a preferred constraint instead of a union
* Add reduceType
* Switch tests to use infer..extends
* Add missing primitive constraint cases
* Update .types tests
* Remove TemplateTypePlaceholderPriority
* Remove reduceType
* Port #48978 forward to the revised FAR code
The old regression test didn't catch the corresponding bug in the new code because it hit the fast path where there's only a single project.
* Drop spurious non-null assertion
* Handle the case where the FAR results map is empty
Searching exactly one project does not imply the presence of exactly one references list.
Fixes#49217
* Use emptyArray
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
* Add failing test
* Fix the implicit glob key so that recursive keys are not differing just by directory seperator
Fixes#49078
* Reset the reload level once program is loaded