Anders Hejlsberg
627f1ad876
Add regression tests
2018-11-09 06:45:21 +01:00
Anders Hejlsberg
48c0aedf54
Add tests
2018-11-02 08:20:06 -07:00
Anders Hejlsberg
8e4b90da00
Merge pull request #28234 from Microsoft/genericSpread
...
Generic spread expressions in object literals
2018-10-31 12:52:16 -07:00
Anders Hejlsberg
2ed627aaf1
Update tests
2018-10-30 16:33:14 -07:00
Anders Hejlsberg
e0d210d027
Add tests
2018-10-30 08:18:18 -07:00
Nathan Shively-Sanders
64ff195426
Set-only accessors spread to undefined ( #28213 )
...
* Set-only accessors spread to undefined
Previously they were skipped. The runtime behaviour is to create a
property of type undefined, unlike (for example) spreading numbers or
other primitives. So now spreading a set-only accessor creates a
property of type undefined:
```ts
const o: { foo: undefined } = { ...{ set foo(v: number) { } } }
```
Notably, `o.foo: undefined` not `number`.
Fixes #26337
* Fix isSpreadableProperty oversimplification
2018-10-29 14:51:12 -07:00
Anders Hejlsberg
24e3745296
Add regression test
2018-10-26 15:32:10 -07:00
Anders Hejlsberg
04fd365ec3
Merge pull request #27911 from Microsoft/fixCircularMappedType
...
Fix circular mapped type instantiations for arrays and tuples
2018-10-15 15:51:31 -07:00
Anders Hejlsberg
9767522ca0
Merge pull request #27695 from Microsoft/mixedDiscriminantTypes
...
Allow non-unit types in union discriminants
2018-10-15 13:10:27 -07:00
Anders Hejlsberg
0c3221c220
Add regression test
2018-10-15 10:24:00 -07:00
Sheetal Nandi
c0729a22fd
Use string/number signature to get contextual type
...
Fixes #26587
2018-10-11 15:12:13 -07:00
Anders Hejlsberg
22907bfb07
Add tests
2018-10-10 15:40:12 -07:00
Anders Hejlsberg
209f30c2f1
Update test
2018-10-08 16:46:45 -07:00
Anders Hejlsberg
d4f480cbbb
Add tests
2018-10-06 17:03:19 -07:00
Anders Hejlsberg
34994627f0
Add tests
2018-10-01 16:21:35 -07:00
Anders Hejlsberg
4bb5cfb9bb
Add regression test
2018-09-25 18:17:21 -07:00
Ron Buckton
5fb39769ad
Merge pull request #27271 from Microsoft/fix24570-3
...
Fix iterated type in for-await-of
2018-09-21 12:28:18 -07:00
Ron Buckton
112fe6e2cc
Fix iterated type in for-await-of
2018-09-21 10:40:45 -07:00
Ron Buckton
3a4d0b237f
Add more tests for await
2018-09-21 10:32:28 -07:00
Ron Buckton
63adc5fb40
Add contextual typing for await operand
2018-09-21 10:32:18 -07:00
Ron Buckton
80dba4d63b
Support promise-like types in contextual return type of async function
2018-09-21 10:32:00 -07:00
Anders Hejlsberg
eb06af1901
Add tests
2018-09-17 13:01:53 -07:00
Ryan Cavanaugh
6465e9dcdd
Merge pull request #26292 from Kingwl/tupleIndexAccessCheck
...
check index access for fixed length tuple
2018-09-05 12:10:46 -07:00
Nathan Shively-Sanders
c929e74310
Add [Constructor]Parameter types to lib.d.ts ( #26243 )
2018-08-31 07:46:16 -07:00
Nathan Shively-Sanders
cc3d011333
Infer this parameters ( #26800 )
...
Previously we didn't. I can't remember why, probably because I
overlooked it in the initial PR.
2018-08-31 07:45:34 -07:00
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