Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-nullable types #7140

Merged
merged 65 commits into from
Mar 21, 2016
Merged
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
26cc99b
Introduce -strictNullChecks compiler option
ahejlsberg Feb 15, 2016
8e92603
Parsing of nullable types
ahejlsberg Feb 15, 2016
26e371d
Use TypeFlags.Undefined for both undefined and null types
ahejlsberg Feb 15, 2016
98b6a5a
Make undefined and null assignable to each other
ahejlsberg Feb 15, 2016
e79df80
Accepting new baselines
ahejlsberg Feb 15, 2016
6d6d2a1
Introduce nullable types in checker
ahejlsberg Feb 15, 2016
f08f606
Display support for nullable types
ahejlsberg Feb 15, 2016
fa36ff8
Don't widen undefined types in unions
ahejlsberg Feb 15, 2016
0d3005b
Support nullable types with expression operators
ahejlsberg Feb 15, 2016
09fa3e5
Ensure empty array literal is assignable to array of non-null type in…
ahejlsberg Feb 15, 2016
41401c7
Make types of optional parameters and properties nullable
ahejlsberg Feb 16, 2016
586c3ac
Exclude undefined/null from flags propagation within union types
ahejlsberg Feb 16, 2016
bf89530
Add truthy/falsey guards for nullable types
ahejlsberg Feb 16, 2016
bd12f1b
Add missing semicolon
ahejlsberg Feb 16, 2016
1f096bd
Add '!' non-null assertion postfix operator
ahejlsberg Feb 18, 2016
46837fd
Disallow line breaks between operand and '!' non-null assertion operator
ahejlsberg Feb 18, 2016
54ee0b1
Accepting new baselines
ahejlsberg Feb 18, 2016
1e8a7e2
Correct && operator to produce nullable values
ahejlsberg Feb 18, 2016
44d7897
Merge branch 'master' into strictNullChecks
ahejlsberg Feb 19, 2016
50ea0bf
Support x == null and x != null in non-null guards. Also, allow == an…
ahejlsberg Feb 19, 2016
d10017f
Accepting new baselines
ahejlsberg Feb 19, 2016
ed40fbf
Suport both x != null and x != undefined in non-null type guards
ahejlsberg Feb 20, 2016
74d8c40
Merge branch 'master' into strictNullChecks
ahejlsberg Feb 20, 2016
5e5381d
Merge branch 'master' into strictNullChecks
ahejlsberg Feb 21, 2016
3d7631d
Support dotted names ("x.y.z") in type guards
ahejlsberg Feb 27, 2016
82169ce
Fix getTypeOfSymbolAtLocation to handle hypothetical lookups
ahejlsberg Feb 28, 2016
7dd59ce
Accepting new baselines
ahejlsberg Feb 28, 2016
ea35932
Fix linting error
ahejlsberg Feb 28, 2016
33e3825
Assigned-before-use checking for non-nullable variables
ahejlsberg Mar 3, 2016
ea4b13b
Allow 'null' and 'undefined' as type names
ahejlsberg Mar 3, 2016
ed95811
Fix unit test
ahejlsberg Mar 3, 2016
04c28b0
Accepting new baselines
ahejlsberg Mar 3, 2016
87ae048
Reinstate separate type kinds for 'null' and 'undefined'
ahejlsberg Mar 4, 2016
c623e1f
No widening of 'null' and 'undefined' types in --strictNullChecks mode
ahejlsberg Mar 4, 2016
1302418
Accepting new baselines
ahejlsberg Mar 4, 2016
d6fcd1a
Consider for-in and for-of variables to be definitely assigned
ahejlsberg Mar 4, 2016
15b2405
Extract and lift nullability over best common supertype
ahejlsberg Mar 4, 2016
25a72d6
Removing unused functions
ahejlsberg Mar 4, 2016
64f5727
Introduce comparable (a.k.a. possibly assignable) relation
ahejlsberg Mar 5, 2016
436e70e
Accepting new baselines
ahejlsberg Mar 5, 2016
a0790fb
Add only 'undefined' to optional parameter types
ahejlsberg Mar 5, 2016
eed4093
Fix bugs in reduceLeft and reduceRight
ahejlsberg Mar 5, 2016
2762772
Include 'undefined' in return type for implicit or expressionless ret…
ahejlsberg Mar 5, 2016
097f456
Remove unused variable
ahejlsberg Mar 5, 2016
689e28d
Keep linter happy with fix in reduceLeft/reduceRight
ahejlsberg Mar 5, 2016
8db7af0
Proper handling of 'null' and 'undefined' in equals and not equals gu…
ahejlsberg Mar 5, 2016
d0e4b4a
Treat 'return' as 'return undefined' for type checking purposes
ahejlsberg Mar 5, 2016
129a4f1
Check return type includes 'undefined' in function with implicit return
ahejlsberg Mar 6, 2016
50d874e
Improve type relationship error reporting for nullable types
ahejlsberg Mar 6, 2016
0a25bb5
Make 'undefined' assignable to 'void'
ahejlsberg Mar 6, 2016
187eaae
Fix issue with narrowing exported variables
ahejlsberg Mar 7, 2016
fbda0bd
Adding another check for undefined
ahejlsberg Mar 8, 2016
868e53d
Accepting new baselines
ahejlsberg Mar 8, 2016
cf9e08b
Merge branch 'master' into strictNullChecks
ahejlsberg Mar 9, 2016
796613c
Better error message + fix assignment analysis of 'switch' statement
ahejlsberg Mar 10, 2016
dad0564
Support 'this' in type guards
ahejlsberg Mar 10, 2016
6772c34
Accepting new baselines
ahejlsberg Mar 10, 2016
9c58875
Fix linting error
ahejlsberg Mar 10, 2016
4c641c4
Add 'undefined' to type of parameter with default value in signature
ahejlsberg Mar 10, 2016
f774ecf
Remove 'undefined' from type of binding element with non-undefined de…
ahejlsberg Mar 10, 2016
b1bef15
Removing 'T?' type notation (use 'T | null | undefined' instead)
ahejlsberg Mar 14, 2016
09ad9c5
Remove 'T?' notation from type-to-string conversion
ahejlsberg Mar 14, 2016
b497243
Merge branch 'master' into strictNullChecks
ahejlsberg Mar 14, 2016
413d9a6
Merge branch 'master' into strictNullChecks
ahejlsberg Mar 21, 2016
fb6255a
Accepting new baselines
ahejlsberg Mar 21, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add missing semicolon
  • Loading branch information
ahejlsberg committed Feb 16, 2016
commit bd12f1b9138f826847667f2c42aa0414c562dcf0
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7200,7 +7200,7 @@ namespace ts {
function narrowType(type: Type, expr: Expression, assumeTrue: boolean): Type {
switch (expr.kind) {
case SyntaxKind.Identifier:
return narrowTypeByTruthiness(type, <Identifier>expr, assumeTrue)
return narrowTypeByTruthiness(type, <Identifier>expr, assumeTrue);
case SyntaxKind.CallExpression:
return narrowTypeByTypePredicate(type, <CallExpression>expr, assumeTrue);
case SyntaxKind.ParenthesizedExpression:
Expand Down