Skip to content

Commit 421ea01

Browse files
make it parse
1 parent 62eaaf9 commit 421ea01

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/compiler/checker.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -7986,8 +7986,8 @@ namespace ts {
79867986
return getTypeFromIntersectionTypeNode(<IntersectionTypeNode>node);
79877987
case SyntaxKind.JSDocNullableType:
79887988
return getTypeFromJSDocNullableTypeNode(<JSDocNullableType>node);
7989-
case SyntaxKind.ParenthesizedType:
79907989
case SyntaxKind.JSDocNonNullableType:
7990+
case SyntaxKind.ParenthesizedType:
79917991
case SyntaxKind.JSDocOptionalType:
79927992
case SyntaxKind.JSDocTypeExpression:
79937993
return getTypeFromTypeNode((<ParenthesizedTypeNode | JSDocTypeReferencingNode | JSDocTypeExpression>node).type);
@@ -22374,7 +22374,8 @@ namespace ts {
2237422374
return checkUnionOrIntersectionType(<UnionOrIntersectionTypeNode>node);
2237522375
case SyntaxKind.ParenthesizedType:
2237622376
case SyntaxKind.TypeOperator:
22377-
return checkSourceElement((<ParenthesizedTypeNode | TypeOperatorNode>node).type);
22377+
case SyntaxKind.JSDocNonNullableType:
22378+
return checkSourceElement((<ParenthesizedTypeNode | TypeOperatorNode | JSDocNonNullableType>node).type);
2237822379
case SyntaxKind.JSDocComment:
2237922380
return checkJSDocComment(node as JSDoc);
2238022381
case SyntaxKind.JSDocParameterTag:
@@ -22383,7 +22384,6 @@ namespace ts {
2238322384
checkSignatureDeclaration(node as JSDocFunctionType);
2238422385
// falls through
2238522386
case SyntaxKind.JSDocVariadicType:
22386-
case SyntaxKind.JSDocNonNullableType:
2238722387
case SyntaxKind.JSDocNullableType:
2238822388
case SyntaxKind.JSDocAllType:
2238922389
case SyntaxKind.JSDocUnknownType:

tests/cases/compiler/nonNullType.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// @strictNullChecks: true
2+
type z = string | undefined | null | never;
3+
type a = string | undefined | null | never;
4+
type b = a!;
5+
type Assert<T> = T!;
6+
type c = Assert<a>;
7+

0 commit comments

Comments
 (0)