Changed redundant type name so type evaluator can be compiled with --emitDeclarationOnly option.

This commit is contained in:
Eric Traut 2022-03-14 23:14:27 -06:00
parent 7c407527d6
commit 5ea3ae41e4

View File

@ -116,8 +116,8 @@ export function synthesizeDataClassMethods(
}
// Maintain a list of "type evaluators".
type TypeEvaluator = () => Type;
const localEntryTypeEvaluator: { entry: DataClassEntry; evaluator: TypeEvaluator }[] = [];
type EntryTypeEvaluator = () => Type;
const localEntryTypeEvaluator: { entry: DataClassEntry; evaluator: EntryTypeEvaluator }[] = [];
let sawKeywordOnlySeparator = false;
node.suite.statements.forEach((statementList) => {
@ -125,7 +125,7 @@ export function synthesizeDataClassMethods(
statementList.statements.forEach((statement) => {
let variableNameNode: NameNode | undefined;
let aliasName: string | undefined;
let variableTypeEvaluator: TypeEvaluator | undefined;
let variableTypeEvaluator: EntryTypeEvaluator | undefined;
let hasDefaultValue = false;
let isKeywordOnly = ClassType.isDataClassKeywordOnlyParams(classType) || sawKeywordOnlySeparator;
let defaultValueExpression: ExpressionNode | undefined;