fix(40617): handle uninitialized class member with computed key (#45974)

This commit is contained in:
Oleksandr T
2022-03-04 16:03:36 -08:00
committed by GitHub
parent f9ae305dda
commit 162713fac9
46 changed files with 1374 additions and 164 deletions
+1 -1
View File
@@ -2755,7 +2755,7 @@ namespace ts {
function getPropFromRaw<T>(prop: "files" | "include" | "exclude" | "references", validateElement: (value: unknown) => boolean, elementTypeName: string): PropOfRaw<T> {
if (hasProperty(raw, prop) && !isNullOrUndefined(raw[prop])) {
if (isArray(raw[prop])) {
const result = raw[prop];
const result = raw[prop] as T[];
if (!sourceFile && !every(result, validateElement)) {
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, prop, elementTypeName));
}