Commit graph

191 commits

Author SHA1 Message Date
Nathan Shively-Sanders
11377f9fd3 Primitive type guards are now order independent 2016-06-08 15:56:25 -07:00
Anders Hejlsberg
a57ee29ff7 Add tests 2016-06-08 11:41:44 -07:00
Wesley Wigham
9761c3be97
Revert "Revert "Merge pull request #7235 from weswigham/narrow-all-types""
This reverts commit fc3e040c51.
2016-06-06 12:52:34 -07:00
Anders Hejlsberg
13698a9952 Add test 2016-06-02 17:37:25 -07:00
Nathan Shively-Sanders
fc3e040c51 Revert "Merge pull request #7235 from weswigham/narrow-all-types"
This reverts commit ef0f6c8fe4, reversing
changes made to 9f087cb62a.
2016-06-02 12:57:24 -07:00
Nathan Shively-Sanders
d111a0f733 Merge branch 'master' into narrow-all-types 2016-06-01 11:27:50 -07:00
Anders Hejlsberg
d20664aa69 Fix test 2016-05-26 16:26:30 -07:00
Nathan Shively-Sanders
a323fdf49d Instantiate this-type in super property access 2016-05-24 13:07:34 -07:00
Nathan Shively-Sanders
b0a387aafa Address PR comments
And address bug with contextually typed arguments that the PR changes
exposed.
2016-05-05 15:04:17 -07:00
Nathan Shively-Sanders
aa38cdba56 Contextually type IIFE params by their arguments 2016-05-05 11:58:36 -07:00
Wesley Wigham
a80529b989
Add test for narrowing to unions of string literals 2016-04-26 04:37:00 -04:00
Wesley Wigham
a2feb0ee7d
string literal case test 2016-04-26 03:13:08 -04:00
Wesley Wigham
20d8a94d66
Remove check narrowing only certain types, add test showing issues with this 2016-04-26 03:13:08 -04:00
Anders Hejlsberg
b1e9f43d28 Merge branch 'master' into controlFlowTypes
Conflicts:
	src/compiler/checker.ts
	tests/baselines/reference/typeAssertions.errors.txt
2016-04-10 09:30:30 -07:00
Anders Hejlsberg
92df0297c8 Fixing tests 2016-04-09 18:31:19 -07:00
Anders Hejlsberg
e53f390b3e Fix some tests 2016-03-29 19:59:05 -07:00
Anders Hejlsberg
0820249e71 Fixing some tests 2016-03-26 08:20:06 -07:00
Ivo Gabe de Wolff
4f936c468b Add control flow tests 2016-03-25 21:29:58 +01:00
Nathan Shively-Sanders
fa22250110 Merge branch 'master' into this-function-types 2016-03-09 13:36:42 -08:00
Nathan Shively-Sanders
4012587808 Update baselines: 'this' in object literal methods 2016-03-09 13:08:09 -08:00
Daniel Rosenwasser
b71ec381f9 Added tests for ASI and element access with 'let'. 2016-02-20 00:58:20 -08:00
Daniel Rosenwasser
050f52f07d Added tests. 2016-02-12 15:22:06 -08:00
Wesley Wigham
22979db64c Add test 2016-02-12 15:08:07 -08:00
Kanchalai Tanglertsampan
bf854a784f Merge branch 'master' into fix4211 2016-01-28 14:33:50 -08:00
Kanchalai Tanglertsampan
e910e7151b Merge branch 'master' into fix4211 2016-01-27 10:36:08 -08:00
Anders Hejlsberg
ea4e3afd98 Fix tests 2016-01-24 13:44:22 -08:00
Daniel Rosenwasser
403a93d21f Merge pull request #6330 from weswigham/restorative-narrowing
Fix #6277
2016-01-14 16:07:59 -08:00
Wesley Wigham
7bb2ee56d0 Fix #6277 - stop looking for any specifically, and use isTypeSubtypeOf like the old code 2016-01-03 07:43:30 -05:00
Nathan Shively-Sanders
7882fd39e7 Merge branch 'master' into allow-type-predicates-as-return-types-only 2015-12-22 11:25:45 -08:00
Yui T
0af52c3d47 Merge branch 'master' into fix4211 2015-12-14 21:51:36 -08:00
Wesley Wigham
459430165d grand unified theory of predicate types 2015-12-08 17:08:57 -08:00
Wesley Wigham
b6eb4ae10f fix generic instantiation, nested this guards now work 2015-12-08 15:00:47 -08:00
Nathan Shively-Sanders
1b63040d36 Add tests and accept baselines 2015-12-08 09:13:41 -08:00
Wesley Wigham
be6e341d2a Fix narrowing, interfaces. Expose issue with generic instantiation 2015-12-07 18:16:05 -08:00
Wesley Wigham
b9f310d4f2 first pass at this type predicate members 2015-12-03 18:21:36 -08:00
Wesley Wigham
d7208e81d6 feedback from pr 2015-12-03 13:46:37 -08:00
Wesley Wigham
859cc53c11 Add tests, remove internal annotation form enum 2015-12-02 19:49:43 -08:00
Yui T
c2fb694404 Update baselines 2015-11-30 09:43:30 -08:00
Wesley Wigham
9531d929c7 update test with pr feedback 2015-11-17 14:34:02 -08:00
Wesley Wigham
321bb9aafa Merge branch 'master' into type-guard-narrowing 2015-11-17 13:50:56 -08:00
Wesley Wigham
581f52a7ea exhaustive tests 2015-11-13 13:33:54 -08:00
Wesley Wigham
346253a0d5 test, first pass at a fix 2015-11-13 11:13:10 -08:00
Wesley Wigham
6c29ddf162 loosen walk up containers, add extra test 2015-11-11 15:30:09 -08:00
Wesley Wigham
5f184866af Merge branch 'master' into empty-set 2015-11-09 12:17:07 -08:00
Mohamed Hegazy
c3df2890fc Merge pull request #5092 from tinganho/instanceOfElseClause
Instance of else clause
2015-11-07 12:20:36 -08:00
Wesley Wigham
d4353fd0c8 Merge branch 'master' into empty-set 2015-11-03 14:40:00 -08:00
Wesley Wigham
9f12bc8a1b feedback from pr, new tests 2015-10-29 17:51:36 -07:00
Wesley Wigham
062495c426 naive change and new tests 2015-10-28 13:48:32 -07:00
Vladimir Matveev
55327781c2 suppress reachability errors in remaining tests 2015-10-13 13:06:43 -07:00
Vladimir Matveev
238e1c6f4b partially suppress reachability errors in tests 2015-10-13 11:17:10 -07:00
Vladimir Matveev
bc02341e99 addressed PR feedback, updated tests to suppress reachability errors where they are not needed 2015-10-13 10:58:55 -07:00
Tingan Ho
dd54b7a36f Adds tests 2015-10-06 19:03:11 +08:00
Ryan Cavanaugh
b2797bbaab Correctly emit 'as' operator left operand as expression
Fixes #4832
2015-09-28 17:24:59 -07:00
Vladimir Matveev
68d6d8c550 use Harness.IO instead of sys in harness 2015-08-21 00:31:25 -07:00
Jason Freeman
8e5f34fb4b Add downlevel emit tests 2015-07-15 15:04:24 -07:00
Jason Freeman
75f97f302a Add tests 2015-07-15 14:42:17 -07:00
Ryan Cavanaugh
b3ca00986f Merge remote-tracking branch 'upstream/master' into jsxAndAs 2015-06-22 22:41:41 -07:00
Ryan Cavanaugh
2b44dcac4d Conformance tests for 'as' operator 2015-06-18 14:03:14 -07:00
Tingan Ho
752e0ba003 Fixes type predicate crash bug 2015-06-18 23:04:05 +08:00
Jason Freeman
75ed565f81 Don't consume 'is' keyword if there is a preceding line terminator 2015-06-09 11:12:00 -07:00
Tingan Ho
51a43dd9d5 Addresses CR feedback 2015-06-08 13:34:49 +08:00
Tingan Ho
b1a8a5fe66 Addresses CR feedback 2015-06-07 22:16:09 +08:00
Tingan Ho
487dff564f Fixes CR feedback 2015-06-06 13:59:19 +08:00
Tingan Ho
fa9a914648 Adds error for non-return positioned type predicates and changed parse type predicate logic 2015-06-05 16:36:02 +08:00
Tingan Ho
19e725636e Adds PR feedback and removed references to typeguard (class) methods 2015-06-04 19:31:16 +08:00
Tingan Ho
b7d1df68fb Adds type guard methods 2015-06-03 16:58:56 +08:00
Tingan Ho
f8e2b99b6c Adds tests 2015-06-03 16:58:56 +08:00
Tingan Ho
78a36c0cee Fixes concat style 2015-05-16 16:42:49 +08:00
Tingan Ho
629b4bbfdf Saved 2015-05-15 15:45:08 +08:00
Tingan Ho
a97ea4b657 Corrects old tests. 2015-05-15 08:38:44 +08:00
Tingan Ho
fdfbcf6ffc Adds tests 2015-05-15 08:38:43 +08:00
Mohamed Hegazy
8b43b3d18c Update test 2015-05-06 20:18:32 -07:00
Mohamed Hegazy
5e94ce65ed Merge branch 'typeguardsByConstructorSigniture' of https://github.com/vvakame/TypeScript into vvakame-typeguardsByConstructorSigniture 2015-05-06 12:44:45 -07:00
vvakame
776f390786 PR feedback 2015-05-06 21:18:15 +09:00
Yui
183c1c47ab Merge pull request #2753 from Microsoft/conformanceArrayLiteral
Conformance test for update in section 4.6 Array Literal
2015-05-04 10:50:41 -07:00
Yui
3da13152f0 Merge pull request #2761 from Microsoft/conformanceContextuallyTypedFuncExp
Conformance test for update spec section 4.9.3 contextual typing in function expression
2015-05-04 10:48:42 -07:00
Yui
031c344bd6 Merge pull request #2785 from Microsoft/conformanceTypeGuard
Conformance for spec update section 4.20 Add additional tests for typeguard for class or object property
2015-05-04 10:47:06 -07:00
vvakame
ab10d509f5 support instantiate signature, it has type parameters. 2015-05-02 15:27:06 +09:00
vvakame
35d6e98e98 type narrowing by constructor signiture of interface 2015-04-30 23:12:35 +09:00
Yui T
ac8ae27139 Address code review 2015-04-16 20:09:03 -07:00
Yui T
d94027b146 Add conformance tests for arugment expression, getSetAccessor, arrayLiteralExpression 2015-04-16 20:01:29 -07:00
Yui T
6d9c1f4c4a Add spec description into tests 2015-04-16 15:39:12 -07:00
Yui T
845b618b42 Add spec description to the test file and move tests that generate errors to separate file 2015-04-16 14:41:19 -07:00
Yui T
8899d5f056 Add additional tests for typeguard for class or object property 2015-04-15 16:55:59 -07:00
Yui T
496e23881b Change file name to be more consistent 2015-04-14 13:00:13 -07:00
Yui T
a689b9df38 Conformance test for update incontextual type in function expression 2015-04-14 10:26:47 -07:00
Yui T
d475170321 Conformance test for update in section 4.6 2015-04-13 16:16:04 -07:00
Ron Buckton
0546042df3 Add support for parsing destructuring patterns in arrow function parameter lists 2015-04-08 18:01:21 -07:00
Jason Freeman
f3543b718f In ES6, an Iterable should contextually type an array literal 2015-02-26 18:17:41 -08:00
Anders Hejlsberg
bbe51cfafe Adding tests 2015-02-04 15:39:57 -08:00
Anders Hejlsberg
34ed45df8e Adding more tests 2015-02-02 10:26:31 -08:00
Anders Hejlsberg
005676005f Adding test 2015-01-30 14:14:22 -08:00
Daniel Rosenwasser
e4d3051532 Added Jason's example for contextually typing parameters. 2015-01-27 22:39:48 -08:00
Daniel Rosenwasser
26929ee5f2 Merge pull request #1816 from Microsoft/typeArgsInSuperCall
Contextually type parameters in super calls using type arguments on the base class.
2015-01-27 17:29:48 -08:00
Daniel Rosenwasser
93dbcf006f Contextually type parameters in super calls using type arguments on the base class. 2015-01-26 18:42:17 -08:00
Anders Hejlsberg
0410394de0 Modifying test 2015-01-25 16:25:38 -08:00
Anders Hejlsberg
7f63180b64 Adding tests 2015-01-24 17:23:22 -08:00
Anders Hejlsberg
ccffc9f25f Adding more tests 2015-01-22 15:12:55 -08:00
Anders Hejlsberg
963de957cb Adding regression test 2015-01-22 14:52:15 -08:00
Anders Hejlsberg
f34620db63 Modifying and adding tests 2015-01-21 13:55:07 -08:00