mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Display support for nullable types
This commit is contained in:
parent
6d6d2a11bc
commit
f08f6067e8
@ -53,7 +53,6 @@ namespace ts {
|
||||
const allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === ModuleKind.System;
|
||||
const strictNullChecks = compilerOptions.strictNullChecks;
|
||||
|
||||
|
||||
const emitResolver = createResolver();
|
||||
|
||||
const undefinedSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "undefined");
|
||||
@ -1873,6 +1872,10 @@ namespace ts {
|
||||
else if (type.flags & TypeFlags.Tuple) {
|
||||
writeTupleType(<TupleType>type);
|
||||
}
|
||||
else if (isNullableType(type)) {
|
||||
writeType(getNonNullableType(type), TypeFormatFlags.InElementType);
|
||||
writePunctuation(writer, SyntaxKind.QuestionToken);
|
||||
}
|
||||
else if (type.flags & TypeFlags.UnionOrIntersection) {
|
||||
writeUnionOrIntersectionType(<UnionOrIntersectionType>type, flags);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user