Commit graph

708 commits

Author SHA1 Message Date
Nathan Shively-Sanders b687caf3eb
No excess property error for spread properties (#26798)
That is, properties in an object literal type that came from a spread
assignment never cause an excess property error.
2018-08-30 16:16:58 -07:00
Anders Hejlsberg c48c3632bd Update tests 2018-08-29 14:02:15 -07:00
Anders Hejlsberg a2d2f5aee6 Merge branch 'master' into complexRestParameterTypes 2018-08-29 07:51:07 -07:00
Anders Hejlsberg 9f83958dbe Add tests 2018-08-27 16:06:17 -07:00
Anders Hejlsberg 676892ee56 Add tests 2018-08-25 07:55:13 -07:00
Nathan Shively-Sanders 0043ba16b1
Allow weak type detection for intersection sources (#26668)
Previously, intersections were only allowed as targets, but this was
just an artifact of the original implementation, which operated inside
the structural part of isRelatedTo. Removing this restriction catches
subtle bugs in React user code, where a function named `create` returns
a mapped type whose types are all branded numbers. The display of these
properties, for some original type `T`, is not `number & { __ }` but
the much-less-obvious `RegisteredStyle<T>`.
2018-08-24 10:30:39 -07:00
Anders Hejlsberg 74c57caa90 Add regression test 2018-08-22 07:16:31 -07:00
Anders Hejlsberg 596493cce4 Add tests 2018-08-17 10:11:28 -07:00
王文璐 6432bd9def check index access for fixed length tuple 2018-08-10 10:49:37 +08:00
Andy 639fdcc916
Don't include class getter in spread type (#26287)
* Don't include class getter in spread type

* Code review
2018-08-09 15:34:29 -07:00
Anders Hejlsberg efdbbd1cf3 Add regression tests 2018-08-06 10:02:33 -07:00
Anders Hejlsberg 32a9ec6c30 Add tests 2018-07-29 15:25:54 -07:00
Anders Hejlsberg 1aa2b15f8c Add regression test 2018-07-25 12:42:47 -07:00
Anders Hejlsberg dd4fd8c60e
Merge pull request #25913 from Microsoft/fixCircularConstraintCheck
Fix circular constraint check
2018-07-25 06:46:51 -07:00
Anders Hejlsberg aeae05eaf5 Add regression test 2018-07-24 15:33:02 -07:00
Matt McCutchen f72193eedc Report a semantic error for an arrow function with a "this" parameter.
Fixes #9744.
2018-07-23 10:42:56 -04:00
Anders Hejlsberg 5822a8c923 Merge branch 'master' into genericRestArityCheck
# Conflicts:
#	src/compiler/checker.ts
2018-07-12 08:20:48 -10:00
Anders Hejlsberg 55180f7725 Add tests 2018-07-12 07:07:13 -10:00
Nathan Shively-Sanders 42a2d9e568
Excess property understands conditional types (#25584)
Previously it did not, causing misleading excess property errors. Note
that assignability errors with conditional types are still usually
confusing. This PR doesn't address that.

Also, make sure that exact matches in getSpellingSuggestion are skipped.
2018-07-11 11:24:40 -07:00
Nathan Shively-Sanders c228924543
Index signatures contribute properties to unions (#25307)
* Index signatures contribute properties to unions

This means that in a union like this:

```ts
type T = { foo: number } | { [s: string]: string }
```

`foo` is now a property of `T` with type `number | string`. Previously
it was not.

Two points of interest:

1. A readonly index signature makes the resulting union property readonly.
2. A numeric index signature only contributes number-named properties.

Fixes #21141

* Correctly handle numeric and symbol property names

1. Symbol-named properties don't contribute to unions.
2. Number-named properties should use the numeric index signature type,
if present, and fall back to the string index signature type, not the
other way round.
2018-07-06 10:46:05 -07:00
Anders Hejlsberg e5d520e463 Add tests 2018-07-02 17:50:42 -10:00
Anders Hejlsberg d869e56d33 Add tests 2018-06-25 10:45:38 -10:00
Anders Hejlsberg 9cd8eadfd2 Update tests 2018-06-24 14:32:50 -10:00
Anders Hejlsberg 0cc0fad381 Add tests 2018-06-14 13:06:37 -07:00
Mohamed Hegazy 35d25ff280
Merge pull request #24645 from Kingwl/this-type-accessibility
allow access protected member in this parameter context
2018-06-11 13:17:58 -07:00
王文璐 0bcbbbdd58 disallow static field access 2018-06-05 18:42:21 +08:00
王文璐 9767fbba09 allow access protected member in this parameter context 2018-06-04 15:16:59 +08:00
Anders Hejlsberg 54f9c17045 Add regression test 2018-06-03 11:59:24 -07:00
Anders Hejlsberg 577662de42 Update tests 2018-05-29 17:55:57 -07:00
Anders Hejlsberg c694ffe7a5 Update tests 2018-05-29 12:54:12 -07:00
Anders Hejlsberg 31c73defa7 Update tests 2018-05-27 15:44:01 -07:00
Anders Hejlsberg 73af0adcf0 Add tests 2018-05-27 10:37:59 -07:00
Anders Hejlsberg 9d4096f9c4 Add tests 2018-05-21 16:43:55 -07:00
Anders Hejlsberg 238177657f Add regression test 2018-05-08 09:42:21 -07:00
Ron Buckton f67afa098f Unpatch vfs resolver and default lib rename 2018-05-03 14:18:50 -07:00
Ron Buckton d62a11ffc0 Merge branch 'master' into vfs 2018-05-01 18:58:31 -07:00
Anders Hejlsberg 4c933aef9a Check that test cases produce expected types 2018-05-01 13:05:49 -07:00
Anders Hejlsberg 59355cbfdb Add regression tests 2018-05-01 12:44:46 -07:00
Anders Hejlsberg 936444ad7b Add tests 2018-04-29 07:55:23 -07:00
Anders Hejlsberg 38d1f7f0d2 Add tests 2018-04-27 16:50:09 -07:00
Anders Hejlsberg 6c28da328e
Merge pull request #23672 from Microsoft/intersectionWithUnionConstraint
Type relationships for intersections with union constraints
2018-04-27 15:53:00 -07:00
Anders Hejlsberg 5ecd03e8c0
Merge pull request #23660 from Microsoft/fixIndexTypeTargetConstraint
Fix constraint of 'keyof T[K]' in target position
2018-04-27 15:52:21 -07:00
Nathan Shively-Sanders 3631af6486
Remove readonly from object rest properties (#23746)
* Remove readonly from object rest properties

Works the same as removing it from object spread properties

* Fix bug number in test
2018-04-27 14:54:59 -07:00
Ron Buckton 4863d55d01 Merge branch 'master' into vfs 2018-04-27 14:03:42 -07:00
Anders Hejlsberg 8442a45bb6 Add additional tests 2018-04-25 11:03:25 -07:00
Anders Hejlsberg 50c7ff79d0 Add tests 2018-04-24 15:57:17 -07:00
Anders Hejlsberg ad4f83a281 Merge branch 'master' into fixIndexTypeTargetConstraint
# Conflicts:
#	tests/baselines/reference/keyofAndIndexedAccess.js
#	tests/baselines/reference/keyofAndIndexedAccess.symbols
#	tests/baselines/reference/keyofAndIndexedAccess.types
#	tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts
2018-04-24 11:08:08 -07:00
Anders Hejlsberg 57ef618120 Add regression test 2018-04-24 10:02:47 -07:00
Ron Buckton bb26ab5556 Merge branch 'master' into vfs 2018-04-23 22:48:48 -07:00
Anders Hejlsberg 7befd35009 Add tests 2018-04-23 21:09:49 -07:00
Ron Buckton 1cbe930e06 Merge branch 'master' into vfs 2018-04-17 14:39:20 -07:00
Anders Hejlsberg 16cd5580a6 Merge branch 'master' into improveIndexTypes
# Conflicts:
#	src/compiler/checker.ts
#	src/server/utilities.ts
2018-04-16 16:18:29 -07:00
Anders Hejlsberg 0a37cd3736 Update test 2018-04-10 17:35:27 -10:00
Anders Hejlsberg 0379666bbf Update tests 2018-04-09 08:51:55 -10:00
Nathan Shively-Sanders 154ac342cb
Allow extending any, with noImplicitAny errors (#23153)
Allow extending any, without noImplicitAny errors
2018-04-05 08:52:56 -07:00
Anders Hejlsberg 6646717ce7
Merge pull request #23112 from Microsoft/fixTPReferenceLookups
Fix type parameter reference lookups
2018-04-03 12:32:05 -07:00
Anders Hejlsberg cdf155e980 Add regression test 2018-04-03 09:04:36 -07:00
Nathan Shively-Sanders 11eabc0946
Skip parens and non-null assertions when looking for this-context (#23097)
* Skip parens and ! for getting this-context of call

* Add test and improve code a bit

* Use skipOuterExpressions instead
2018-04-03 06:23:59 -07:00
Anders Hejlsberg 751eab9eed
Merge pull request #23067 from Microsoft/fixTPReferenceInConditional
Fix type parameter reference checks in conditional types
2018-04-02 17:30:32 -07:00
Wesley Wigham 414bc49cc4
Module or import types (#22592)
* Type side of import types

* Value side of import types

* Accept library changes

* Refined implementation, more tests

* Allow resolutions to be performed late if the resolution still results in a file already in the build

* Add another test case

* Add some jsdoc usages

* Allow nodebuilder to use import types where appropriate

* Parse & check generic instantiations

* use import types in nodebuilder for typeof module symbols

* Wire up go to definition for import types

* Accept updated type/symbol baselines now that symbols are wired in

* PR feedback

* Fix changes from merge

* Walk back late import handling

* Remove unused diagnostic

* Remove unrelated changes

* Use recursive function over loop

* Emit type arguments

* undo unrelated change

* Test for and support import type nodes in bundled declaration emit
2018-04-02 10:18:23 -07:00
Anders Hejlsberg ec02ccd575 Add regression test 2018-04-02 09:23:00 -07:00
Anders Hejlsberg b3829523b2
Merge pull request #23039 from Microsoft/fixConditionalConstraints
Improve conditional type constraints
2018-03-31 11:56:05 -07:00
Anders Hejlsberg b84e05e669 Add tests 2018-03-30 16:21:16 -07:00
Anders Hejlsberg 7714a2bb5b
Merge pull request #22989 from Microsoft/fixImpliedConstraint
Fix implied constraints in conditional types
2018-03-29 17:06:16 -07:00
Andy a9aca81601
Error on for (const x in never) (#22988)
* Error on `for (const x in never)`

* Update diagnostic

* Provide argument to diagnostic
2018-03-29 11:39:30 -07:00
Anders Hejlsberg bd442b7e52 Add regression test 2018-03-29 10:22:11 -07:00
Andy 65659d7297
Don't allow to iterate over 'never' (#22964)
* Don't allow to iterate over 'never'

* Include type in error message
2018-03-29 10:01:21 -07:00
Anders Hejlsberg 83276ce163 Add another test 2018-03-28 15:21:29 -07:00
Anders Hejlsberg 0e446fe8c2 Add regression test 2018-03-28 13:16:29 -07:00
Anders Hejlsberg 5b1554f708 Change test to use type variables 2018-03-25 15:30:46 -07:00
Anders Hejlsberg 8f860f672f Add tests 2018-03-25 11:33:24 -07:00
Anders Hejlsberg 7c0cc84abd Add tests 2018-03-25 11:30:08 -07:00
Anders Hejlsberg e5f6ed0b60
Merge pull request #22707 from Microsoft/fixIndexedAccessInConditionalType
Fix indexed access in conditional type
2018-03-21 15:18:39 -07:00
Anders Hejlsberg eb3fd150a7 Add regression test 2018-03-21 13:35:15 -07:00
Anders Hejlsberg 4fef35cdd0 Add regression test 2018-03-21 10:03:48 -07:00
Anders Hejlsberg fa8564fa9e Add test to verify errors on nested 'infer T' declarations 2018-03-21 10:03:07 -07:00
Anders Hejlsberg c94d28dbc8 Add test 2018-03-21 06:47:57 -07:00
Wesley Wigham eaabf920eb
Combine keyof T inferences (#22525)
* Combine keyof T inferences

* Extract covariant inference derivation into function

* Test:keyof inference lower priority than return inference

for #22376

* Update 'expected' comment in keyofInferenceLowerPriorityThanReturn

* Update comment in test too, not just baselines

* Fix typo

* Move tests
2018-03-19 16:56:51 -07:00
Anders Hejlsberg 16f571b026 Add tests 2018-03-19 16:29:00 -07:00
Ron Buckton ea9f999dfc Merge branch 'master' into vfs 2018-03-08 10:46:36 -08:00
Anders Hejlsberg 19e07eaea6 Add tests 2018-03-04 16:49:06 -08:00
Anders Hejlsberg 081a394927 Add regression test 2018-03-03 18:08:36 -08:00
Anders Hejlsberg 95bb156a3e Add tests 2018-03-02 09:26:52 -08:00
Anders Hejlsberg 3fca99522b Update tests 2018-02-28 06:39:36 -08:00
Anders Hejlsberg c9c282b2d7 Update test 2018-02-27 15:15:08 -08:00
Anders Hejlsberg b9e06bfd38 Merge branch 'master' into fixConditionalTypes
# Conflicts:
#	src/compiler/checker.ts
2018-02-26 14:50:23 -08:00
Anders Hejlsberg 3ad62ef3d6 Update tests 2018-02-26 14:26:26 -08:00
Anders Hejlsberg 3de1cd6f2d Add regression tests 2018-02-14 09:20:13 -08:00
Anders Hejlsberg 23162c2638 Add tests 2018-02-13 06:48:03 -08:00
Anders Hejlsberg 318e53cecb Merge branch 'master' into fixIndexedAccessWildcard
# Conflicts:
#	tests/baselines/reference/conditionalTypes1.errors.txt
#	tests/baselines/reference/conditionalTypes1.js
#	tests/baselines/reference/conditionalTypes1.symbols
#	tests/baselines/reference/conditionalTypes1.types
#	tests/cases/conformance/types/conditional/conditionalTypes1.ts
2018-02-10 17:29:06 -08:00
Anders Hejlsberg 2e1dcd666c Add regression test 2018-02-10 17:10:44 -08:00
Anders Hejlsberg fadf031088 Merge branch 'master' into fixStructuralIdentity
# Conflicts:
#	tests/baselines/reference/conditionalTypes1.errors.txt
#	tests/baselines/reference/conditionalTypes1.js
#	tests/baselines/reference/conditionalTypes1.symbols
#	tests/baselines/reference/conditionalTypes1.types
#	tests/cases/conformance/types/conditional/conditionalTypes1.ts
2018-02-09 16:16:02 -08:00
Anders Hejlsberg 92b8ce7821 Update tests 2018-02-09 14:22:57 -08:00
Anders Hejlsberg 35f1fcbe85 Add tests 2018-02-09 13:02:21 -08:00
Anders Hejlsberg e54606b7bf Add tests 2018-02-08 17:14:52 -08:00
Anders Hejlsberg 22fbb8edce
Merge pull request #21744 from Microsoft/fixGetConstrainedTypeParameter
Fix getConstrainedTypeParameter function
2018-02-07 16:37:10 -08:00
Anders Hejlsberg 7ad8182af2
Merge pull request #21737 from Microsoft/fixDeferredConditional
Fix definitely false check in conditional types
2018-02-07 14:59:40 -08:00
Anders Hejlsberg 94e0df39cc Add regression test 2018-02-07 14:55:04 -08:00
Anders Hejlsberg e3c137ce37 Add regression tests 2018-02-07 12:48:55 -08:00
Anders Hejlsberg 2dcd83c954 Add test 2018-02-07 06:57:43 -08:00
Anders Hejlsberg 1f3af4eab2 Add tests 2018-02-06 17:33:02 -08:00
Anders Hejlsberg cac6b5b985 Add regression test 2018-02-06 12:41:04 -08:00
Ron Buckton 3b73ce49d7
Merge pull request #21585 from Microsoft/fix21584
Fix initializer assignability for unique symbol
2018-02-06 11:30:12 -08:00
Ron Buckton 1efb84447c Merge branch 'master' into vfs 2018-02-05 23:36:14 -08:00
Ron Buckton 4eb3b6b016 Merge branch 'master' into vfs 2018-02-05 11:30:06 -08:00
Anders Hejlsberg 4c9e6499d5 Add tests 2018-02-05 06:48:38 -08:00
Anders Hejlsberg a712344733 Add tests 2018-02-03 09:44:47 -08:00
Ron Buckton 6f792f5aec Fix initializer assignability for unique symbol 2018-02-02 13:13:21 -08:00
Anders Hejlsberg afec056bab Add more error case checks 2018-01-31 07:48:45 -08:00
Anders Hejlsberg 7c241ba2f7 Merge branch 'conditionalTypes' into inferTypes
# Conflicts:
#	src/compiler/checker.ts
#	tests/cases/fourslash/completionInJSDocFunctionNew.ts
#	tests/cases/fourslash/completionInJSDocFunctionThis.ts
2018-01-30 13:40:16 -08:00
Anders Hejlsberg 34505c1019 Add tests 2018-01-30 08:11:49 -08:00
Anders Hejlsberg 4f2b5f32f9 Merge branch 'master' into conditionalTypes 2018-01-30 06:42:14 -08:00
Ron Buckton 87de5ffb5c Merge branch 'master' into vfs 2018-01-22 02:25:22 -08:00
Anders Hejlsberg eb314d00fc Add tests 2018-01-20 08:17:59 -08:00
Nathan Shively-Sanders 485ec34e8e Test assignability of indexed access types 2018-01-17 13:22:31 -08:00
Nathan Shively-Sanders 7dbea0e82d Merge branch 'master' into fix2-getConstraintOfIndexedAccess 2018-01-10 12:40:35 -08:00
Ron Buckton e426257d8c Revert more baselines, add jake task for typemock 2017-12-19 13:40:32 -08:00
Ron Buckton 7944f5082b Merge branch 'master' into vfs 2017-12-18 12:12:51 -08:00
Nathan Shively-Sanders 4bc0d85d29 Test:spread object retains lefthandside
1. Make sure that spreading `object` doesn't lose everything to the left.
2. Update baselines to show that `{ ...object }` is now `{}`.
2017-12-12 08:37:34 -08:00
Nathan Shively-Sanders dd0fa41de1 Merge branch 'master' into fix2-getConstraintOfIndexedAccess 2017-12-04 15:26:02 -08:00
Wesley Wigham e684f30d18
Fix build in the presence of definite assignment analysis (#20170) 2017-11-20 14:49:15 -08:00
Anders Hejlsberg 3d153e2ac3 Add tests 2017-11-19 09:50:45 -08:00
Ron Buckton a21a129abb Merge branch 'master' into dynamicNames 2017-11-15 15:24:05 -08:00
Nathan Shively-Sanders 8a7b8445de
Merge pull request #19655 from Microsoft/instantiate-this-in-type-parameter-constraints
Instantiate this when used only in type parameter constraints
2017-11-14 16:22:37 -08:00
Ron Buckton 804c7d3690 Merge branch 'master' into dynamicNames 2017-11-13 13:24:20 -08:00
Ron Buckton ae11ae55c5 Fix getReturnTypeFromBody widening 2017-11-13 13:19:49 -08:00
Nathan Shively-Sanders 80d1a42179 Merge branch 'master' into instantiate-this-in-type-parameter-constraints 2017-11-13 13:13:38 -08:00
Nathan Shively-Sanders 39fd0bf2d1 Merge branch 'master' into fix-spread-contextually-typed-by-binding-pattern 2017-11-13 13:11:05 -08:00
Ron Buckton 4fbc74ec26 Partial deprecation of non-vfs TestServerHost 2017-11-12 21:05:28 -08:00
Ron Buckton 646c32cb09 Merge branch 'master' into vfs 2017-11-11 10:26:40 -08:00
Anders Hejlsberg b8fbf884d0
Merge pull request #19926 from Microsoft/improvePrimitiveComparable
Bidirectional comparable relation for primitive types
2017-11-11 09:15:24 -08:00
Anders Hejlsberg 16b68ff25b Fix typo 2017-11-10 13:46:51 -08:00
Anders Hejlsberg d15926d9c7 Add test 2017-11-10 13:13:32 -08:00
Anders Hejlsberg afec1e1fa1 Update test 2017-11-10 08:39:29 -08:00
Anders Hejlsberg 197c635994 Update tests 2017-11-10 08:36:50 -08:00
Ron Buckton 8245f6246d Update Harness.compileFiles to use vfs 2017-11-09 16:01:33 -08:00
Nathan Shively-Sanders c1c7926735 Revert "Add TupleBase with unusable mutating Array methods"
This reverts commits
4385444c44,
2399d58,
es55de3,
888da3c
2017-11-08 15:18:35 -08:00
Nathan Shively-Sanders 888da3c3da Update baselines 2017-11-06 15:55:16 -08:00
Ron Buckton 33e09f9a9d Merge branch 'master' into dynamicNames 2017-11-06 12:05:25 -08:00
Nathan Shively-Sanders c2374c4ec3 Merge branch 'master' into 6229-known-length-tuples 2017-11-06 10:51:34 -08:00
Anders Hejlsberg b5f4a83365
Merge pull request #19745 from Microsoft/emptyArrayInference
No inference from empty array literals
2017-11-06 10:45:45 -08:00
Nathan Shively-Sanders 868d36d51d
Merge pull request #19770 from Microsoft/remove-readonly-from-spread-index-sigs
Remove readonly from index signatures of a spread
2017-11-06 10:20:57 -08:00
Nathan Shively-Sanders 7788d293c4 Test:spread removes readonly from index signatures 2017-11-06 08:16:15 -08:00
Anders Hejlsberg 0a4f60e87b Add tests 2017-11-04 17:26:12 -07:00
Anders Hejlsberg 9619dc14f9 Add tests 2017-11-04 08:08:28 -07:00
Ron Buckton 208dfa6b01 Merge branch 'master' into dynamicNames 2017-11-03 22:10:28 -07:00
Anders Hejlsberg f701b1300f Add tests 2017-11-03 14:40:06 -07:00
Nathan Shively-Sanders a980d61f86 Add a few tuple tests and update baselines 2017-11-03 09:56:39 -07:00
Nathan Shively-Sanders 75882db684 Merge branch 'master' into 6229-known-length-tuples 2017-11-03 09:07:38 -07:00
Anders Hejlsberg 63f7029b9a Add regression tests 2017-11-02 17:31:17 -07:00
Nathan Shively-Sanders defd32f015 Move strict tuple test and add a couple of cases 2017-11-01 11:53:41 -07:00
Nathan Shively-Sanders b228736596 Merge branch 'master' into 6229-known-length-tuples 2017-11-01 11:51:49 -07:00
Nathan Shively-Sanders e0e1a3b078 Test:this instantiation in type parameters
Make sure that `this` gets instantiated when it's used as a constraint
of a type parameter, and nowhere else in a signature.
2017-11-01 09:17:52 -07:00
Ron Buckton 26ca98c820 Merge branch 'master' into dynamicNames 2017-10-30 18:02:53 -07:00
Anders Hejlsberg ec2aecf90e Add tests 2017-10-29 16:49:43 -07:00
Anders Hejlsberg 414f165df0 Add tests 2017-10-23 12:36:44 -07:00
Ron Buckton 51929acb89 Merge branch 'master' into dynamicNames 2017-10-21 00:36:52 -07:00
Ron Buckton 3341e07e67 Refactor widening 2017-10-20 22:52:20 -07:00
Anders Hejlsberg f8d9079c47 Add regression test 2017-10-18 16:59:43 -07:00
Anders Hejlsberg ee0715a073 Add tests 2017-10-14 11:13:40 -07:00
Nathan Shively-Sanders 0cb12b32a5 Test:{} in union from spread gets implicit index signature
Also tighten up the existing test code in the file.
2017-10-05 09:03:03 -07:00
Ron Buckton 51ded0be7f Additional tests 2017-10-04 19:41:48 -07:00
Ron Buckton ee23f93275 Switch to 'unique symbol' 2017-10-04 19:34:29 -07:00
Ron Buckton 43c151a9df Merge branch 'master' into dynamicNames 2017-10-04 14:57:24 -07:00
Wesley Wigham 648bd6e9e0 Skip more lib checks, improve test execution time a bit more (#18952)
* Skip more lib checks, improve test execution time a bit more

* Change complexRecursiveCollections to still check

* Remove way more
2017-10-04 14:43:35 -07:00
Nathan Shively-Sanders 2c04b5510f Test:spread contextually typed by binding pattern 2017-10-03 12:43:23 -07:00
Ron Buckton 891e71d44f Remove freshness, more comprehensive grammar checks and diagnostic messages 2017-09-22 15:08:55 -07:00
Nathan Shively-Sanders cb8d9d6143 Revert spread-falsy-union/fix spread of primitive
Turns out partialising falsy unions wasn't needed -- I was just
returning the wrong thing when spreading primitives.
2017-09-15 16:11:41 -07:00
Nathan Shively-Sanders 7497d4cb3a Merge branch 'master' into allow-booleans-in-spreads 2017-09-15 10:26:57 -07:00
Nathan Shively-Sanders f97d5fa11d Update tests with improved spread-falsy-union rules 2017-09-15 10:06:58 -07:00
Nathan Shively-Sanders 18653a5c5d Use removeDefinitelyFalsyTypes for building partial type 2017-09-14 11:18:48 -07:00
Anders Hejlsberg 2077835ff7 Merge pull request #18438 from Microsoft/unionIntersectionUnit
Remove empty intersection types in unit types
2017-09-14 18:44:02 +01:00
Nathan Shively-Sanders d2e2faad5c Update tests and baselines 2017-09-13 15:13:34 -07:00
Nathan Shively-Sanders d951c14052 Allow all possibly falsy types in spreads
And update tests to reflect that
2017-09-13 14:56:15 -07:00
Nathan Shively-Sanders 9cddd1aca2 Update spread tests for booleans in spread types 2017-09-13 14:06:15 -07:00
Anders Hejlsberg 78f4cbe53c Add tests 2017-09-13 06:37:59 -07:00
Anders Hejlsberg 9871c04e54 Add tests 2017-09-09 13:06:28 -07:00
Nathan Shively-Sanders 2f646daf0a Move lone test case into central test file 2017-08-28 10:53:11 -07:00
Tycho Grouwstra 1f77317b64 add strictTuples flag giving tuples known length 2017-08-20 02:54:26 +08:00
Nathan Shively-Sanders ecae295c5a Test getConstraintOfIndexedAccess fixes and update baselines 2017-08-18 15:16:24 -07:00
Arthur Ozga 6b68da1185 Revert "Fix getConstraintOfIndexedAccess" 2017-08-18 11:32:53 -07:00
Nathan Shively-Sanders 1b4f90705f Test getConstraintOfIndexedAccess fixes and update baselines 2017-08-17 12:45:20 -07:00
Nathan Shively-Sanders a59f77ffb4 Test:type predicate uses correct index to report errors 2017-08-09 15:45:28 -07:00
Anders Hejlsberg 467245780d Merge pull request #17455 from Microsoft/mappedTypeFixes
Mapped and indexed access type fixes
2017-08-02 13:36:37 -07:00
Anders Hejlsberg 9e900942b5 Add regression tests 2017-07-27 09:51:17 -07:00
Anders Hejlsberg f6ed29df3a Add tests 2017-07-24 17:06:45 -07:00
Nathan Shively-Sanders 95f5bc1ee0 Add unknown property to test of contextual this type 2017-07-18 10:01:22 -07:00
Nathan Shively-Sanders 08ae02263a Contextually type this in object literals in JS
Previously, `this` would only get a contextual type inside object
literals with `--noImplicitThis` turned on in Typescript files.
2017-07-17 15:59:18 -07:00
Nathan Shively-Sanders 26ab0cd138 Merge pull request #16530 from Microsoft/excess-property-check-error-span-for-spread-property
Improve excess property check error span for spread property
2017-06-14 16:16:20 -07:00
Nathan Shively-Sanders 19c564d48d Test:error span for spread prop in excess prop check 2017-06-14 11:29:06 -07:00
Nathan Shively-Sanders 657c469d4f Remove undefined from optional spread properties
Fixes #16509 by making the change from #15938 less strict. This is
technically a hole, but it's not as big a hole as before #15938.
2017-06-14 10:31:11 -07:00
Anders Hejlsberg a74b790ed5 Add tests 2017-06-11 14:54:46 -07:00
Ron Buckton ff1f33729b Improve contextual types and return type checking 2017-06-08 16:44:42 -07:00
Ron Buckton 80a7716117 PR Feedback 2017-06-08 11:27:35 -07:00
Ron Buckton 6bbacb64ce Improve contextual types using jsdoc tags 2017-06-07 17:14:27 -07:00
Anders Hejlsberg 588880487c Merge pull request #16305 from Microsoft/contextualGenericTypes
Contextual generic function types
2017-06-06 17:49:51 -07:00
Nathan Shively-Sanders 617f60e3f0 Merge pull request #16306 from Microsoft/fix-nullable-filtering-in-spreads
Fix nullable filtering in spreads
2017-06-06 15:00:48 -07:00
Anders Hejlsberg 98a5c9b73f Merge branch 'master' into contextualGenericTypes 2017-06-06 14:57:20 -07:00
Nathan Shively-Sanders cfb52e0e91 Test spread in unions of null/undefined 2017-06-06 14:13:02 -07:00
Nathan Shively-Sanders ea830d4fad Move spreadUnion* tests into conformance suite 2017-06-06 13:58:54 -07:00