move TypeVarDepth further up, so its declared before it's used

This commit is contained in:
erik-krogh
2023-12-12 10:34:42 +01:00
parent 13a01e1545
commit c246a9c12c

View File

@@ -1240,6 +1240,13 @@ export class TypeTable {
let indexOnStack = stack.length;
stack.push(id);
/** Indicates if a type contains no type variables, is a type variable, or strictly contains type variables. */
const enum TypeVarDepth {
noTypeVar = 0,
isTypeVar = 1,
containsTypeVar = 2,
}
for (let symbol of type.getProperties()) {
let propertyType = typeTable.tryGetTypeOfSymbol(symbol);
if (propertyType == null) continue;
@@ -1267,13 +1274,6 @@ export class TypeTable {
return lowlinkTable.get(id);
/** Indicates if a type contains no type variables, is a type variable, or strictly contains type variables. */
const enum TypeVarDepth {
noTypeVar = 0,
isTypeVar = 1,
containsTypeVar = 2,
}
function traverseType(type: ts.Type): TypeVarDepth {
if (isTypeVariable(type)) return TypeVarDepth.isTypeVar;
let depth = TypeVarDepth.noTypeVar;