13402 Commits

Author SHA1 Message Date
Sheetal Nandi
021444a248 Make it as api so we can test it 2019-03-26 14:25:56 -07:00
Sheetal Nandi
e28869d888 Ensure that from tsc with --incremental sets source file version
Fixes #30588 and #30589
2019-03-26 14:25:47 -07:00
Sheetal Nandi
684c531386 Always assert that source files are versioned when program is used with Builder 2019-03-26 11:55:12 -07:00
Nathan Shively-Sanders
32054f1c31
Forbid accessing block-scoped variables on globalThis (#30510)
* Forbid accessing const & let on globalThis

It's just an error; you still get the type of the property.

* Disallow access of blockscoped vars on globalThis

Also change Array, Function, String, et al from `const` to `var` so that
they remain accessible via `globalThis.String`.

* Update baselines after lib.d.ts change

Note especially the change in redefineArray, which is now allowed as
long as you provide a type that is assignable to ArrayConstructor.

* Remove blockscoped vars from typeof globalThis

Unlike forbidding them, this removes the properties entirely.

Unfortunately, this means that accessing these properties is only an
error with noImplicitAny, and that error is quite confusing.

Let's discuss our options. I see 3:

1. Forbid access of block-scoped vars as properties (in all flag
settings), but leave them on the type. Simple to implement.
2. Remove block-scoped vars from the globalThis type. Has the bad
error/flag behaviour described above, but simple to implement.
3. Remove block-scoped vars from the globalThis type. Also, forbid
accessing them by executing another resolveName lookup for failed
property accesses on globalThisSymbol. If the second lookup returns a
blockscoped var, issue an error instead of falling back to the index
signature. This seems too complex to me.

* Update baselines

* Better error for block-scoped usage on globalThis

So that value-space references have as clear an error as type-space
references.

* Update fourslash tests

* Fix semi-colon lint

* Don't copy so much when filtering blockscoped vars
2019-03-25 14:07:48 -07:00
Wesley Wigham
1639a5a2c2
Handle huge unions better in createUnionOrIntersectionProperty (#30411)
* Handle huge unions better in createUnionOrIntersectionProperty

* Mimic first-in-wins behavior of pushIfUnique to retain order

* !props -> props.length === 0 (why dont we warn on that ffs)

* Avoid collection into an array if there are no properties
2019-03-22 09:56:39 -07:00
Wesley Wigham
b86dea03f2
Fix crash caused by cyclic defaults (#30532) 2019-03-21 18:27:14 -07:00
Sheetal Nandi
8da384d32a Report output file not built error for any module resolution that ends up to source file
Fixes #29918
2019-03-21 08:55:12 -07:00
Ron Buckton
2932421370
Merge pull request #30495 from Microsoft/fix29427
Adjust offset to account for 'this' parameter when emitting parameter decorators
2019-03-20 12:56:50 -07:00
Sheetal Nandi
e94b7d8b37 Check extended tsconfig time with oldest output time to report not upto date 2019-03-19 17:19:15 -07:00
Sheetal Nandi
8cef0c592a Merge branch 'master' into tsconfigChangeDetection 2019-03-19 16:54:25 -07:00
Ron Buckton
cfb0adeadf
Merge pull request #28609 from ajafff/class-decorator-generics
resolve TypeReference in class decorator at parent of class
2019-03-19 15:46:58 -07:00
Ron Buckton
07bec2893f Adjust offset to account for 'this' parameter when emitting parameter decorators 2019-03-19 11:46:18 -07:00
Ron Buckton
e19c7f1a45 Prevent substitution of 'super' in async super helper 2019-03-19 11:35:18 -07:00
Ron Buckton
4e54f30fb4 Fix _superIndex emit when super access captured in async arrow 2019-03-19 10:20:08 -07:00
Wesley Wigham
9e28a811c5
Remove circularity fallback deferral in getConditionalType (#30470) 2019-03-18 16:35:41 -07:00
Sheetal Nandi
e5521630fb
Merge pull request #30439 from Microsoft/forceBuild
Passing --force option to build, builds project from start
2019-03-18 11:15:25 -07:00
Gabriela Britto
10b9051624
Fix convert to named parameters rest parameter tuple (#30286)
* check if rest parameter is of tuple type in isOptionalParameter

* expose isArrayType and isTupleType in checker

* don't offer refactor if rest parameter type is neither array nor tuple type

* add tests for rest parameters

* fix tests for renamed refactor

* remove unnecessary conditional operator
2019-03-18 10:31:38 -07:00
Masahiro Wakame
18b8625ef8 fix error on globalThis type extend (#30460)
* Add test for extend globalThis

* Fix compile aborting
2019-03-18 09:18:27 -07:00
Anders Hejlsberg
d0646a629a
Merge pull request #30084 from dragomirtitian/GH-26563
Improved argument description for parameters originating from tuples
2019-03-18 06:14:52 -10:00
Anders Hejlsberg
02963b4e17
Merge pull request #30443 from Microsoft/fixTypeInferenceLogicError
Fix logic error introduced in #30334
2019-03-18 08:49:16 -07:00
Anders Hejlsberg
36cf12fe0a
Merge pull request #30363 from Microsoft/fixTypeParameterPromotion
Higher order type parameter promotion fixes
2019-03-18 08:48:03 -07:00
Anders Hejlsberg
3dd0814069 Make IdentifierTypePredicate.parameterIndex index into signature.parameters 2019-03-17 15:58:13 -10:00
Anders Hejlsberg
084d14a399 Fix logic error introduced in #30334 2019-03-15 15:57:22 -10:00
Sheetal Nandi
52641c531a Passing --force option to build, builds project from start 2019-03-15 16:04:10 -07:00
Sheetal Nandi
cabf72b514 Revert "Passing --force option to build, builds project from start"
This reverts commit 434fa94bdca63be629304bfde231ffa25d6754ed.
2019-03-15 16:03:36 -07:00
Sheetal Nandi
434fa94bdc Passing --force option to build, builds project from start 2019-03-15 16:02:00 -07:00
Sheetal Nandi
ce490e1c77 Check oldest output time with tsconfig time to see if its out of date
Fixes #26503
2019-03-15 15:45:51 -07:00
Nathan Shively-Sanders
0f598db3e5
Fixes #29524, a merged UMD-global (#30403)
This kind of merged symbol causes crashes in two places because it's
marked BlockScoped, which makes us assume that it must be something that
is inside a SourceFile. However, block-scoped checks don't make sense
for this kind of symbol, so I exclude them by looking at the kind of
the valueDeclaration, as @mprobst suggested in the original bug.
2019-03-15 09:45:33 -07:00
Wesley Wigham
563593b8be
Enable better error spans for async functions (#30413) 2019-03-14 17:10:42 -07:00
Sheetal Nandi
b7c8e0951d Merge branch 'master' into resolveJsonModule 2019-03-14 15:13:39 -07:00
Sheetal Nandi
03aee92782 PR feedback 2019-03-14 14:15:06 -07:00
Gabriela Britto
1c8a359914
rename convert to named parameters (#30401) 2019-03-14 13:41:29 -07:00
Sheetal Nandi
a571e50143 Use EmitAndSemanticDiagnosticsBuilder in builder from tsc 2019-03-14 11:54:47 -07:00
Sheetal Nandi
bd229b5ed1 Exclude Json files from Project reference redirects from files to be emitted list
Fixes #30382
2019-03-14 11:22:26 -07:00
Sheetal Nandi
a6f7ec3464 Handle outDir and declrationDir correctly to generate output file names for the tsbuild 2019-03-14 10:00:55 -07:00
Wesley Wigham
5d08b68122
Fix react-redux break on DT (#30375)
* Forbid reentrancy in conditional type creation (force deferal on occurance)

* Add repro from react-redux, accept updated baselines
2019-03-13 15:21:46 -07:00
Sheetal Nandi
e42f37fccd
Merge pull request #30374 from Microsoft/jsonSourceFile
Correct the generation of output file names for tsc --b
2019-03-13 15:00:59 -07:00
Sheetal Nandi
b6d520a7a5 Handle recursive symlinks when matching file names
Fixes #28842
2019-03-13 12:30:47 -07:00
Sheetal Nandi
812ff98f61 Correct the generation of output file names for tsc --b
Fixes #30356
2019-03-13 11:23:14 -07:00
Sheetal Nandi
b762d6205e
Merge pull request #30344 from Microsoft/uptoDate
Set oldestOutputFileName in uptodate status when updating just timestamps of output
2019-03-13 10:54:59 -07:00
Sheetal Nandi
8800cc2d15
Merge pull request #30288 from Microsoft/nonModuleNonPrepend
Add output declaration files from referenced project into program if module: none
2019-03-13 10:54:35 -07:00
Anders Hejlsberg
6656671536 Proper contravariance in type parameter promotion 2019-03-13 06:51:05 -07:00
Sheetal Nandi
1463b327fc
Merge pull request #30348 from Microsoft/nonIncrementalPrepend
Schedule bundle update only if project supports incremental build
2019-03-12 18:43:50 -07:00
Anders Hejlsberg
475b103314 Only promote type parameters when they're referenced in input positions 2019-03-12 17:29:19 -07:00
Sheetal Nandi
2477159782 Do not schedule updating bundle if the buildInfo file wont be generated for the project
Fixes #30346
2019-03-12 16:08:01 -07:00
Collins Abitekaniza
7b55d1846b Giving too many arguments should error on the first argument that exceeds arity (#27982)
* span on first arg that exceeds arity

* refactor baseline

* handle cases for spread arguments

* refactor + add coverage for tuple spread cases

* create diagnostic on NodeArray of exceeding args

* test function overloading
2019-03-12 15:57:12 -07:00
Matt McCutchen
ab8153602a Fix mixin logic to preserve at least one constructor type even when the (#27701)
intersection also contains non-constructor types.

Fixes #17388.
2019-03-12 14:30:43 -07:00
Matt McCutchen
6c6f216d0d Handle generic mapped types in getTypeOfPropertyOfContextualType. (#27586)
* Handle generic mapped types in getTypeOfPropertyOfContextualType.

The changes to existing baselines look acceptable to me.

Fixes #24694.

* Minor reorganization, add test case from @yortus
2019-03-12 14:13:32 -07:00
Sheetal Nandi
ffeb38456f Set oldestOutputFileName in uptodate status when updating just timestamps of output
Fixes #29875
2019-03-12 13:30:17 -07:00
Wenlu Wang
d2476759e2 add related error span for default exports (#25396)
* add related error span for default exports

* accept baseline

* stash

* accept baseline and fix lint

* update testcase

* Add missing semicolon
2019-03-12 13:15:14 -07:00