Skip to content

Commit d74f171

Browse files
Fixed createTypeOfDeclaration to widen undefined and null when getting the type for a property assignment. Previously this caused [] to be undefined[] in non strict nulls. It is now any[] as it would be.
1 parent 0cc80b1 commit d74f171

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47591,7 +47591,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4759147591
// Get type of the symbol if this is the valid symbol otherwise get type at location
4759247592
const symbol = getSymbolOfDeclaration(declaration);
4759347593
let type = symbol && !(symbol.flags & (SymbolFlags.TypeLiteral | SymbolFlags.Signature))
47594-
? getWidenedLiteralType(getTypeOfSymbol(symbol))
47594+
? getWidenedType(getWidenedLiteralType(getTypeOfSymbol(symbol)))
4759547595
: errorType;
4759647596
if (
4759747597
type.flags & TypeFlags.UniqueESSymbol &&

0 commit comments

Comments
 (0)