Commit graph

547 commits

Author SHA1 Message Date
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