mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Allow const assertions in constant expressions
This commit is contained in:
@@ -11110,6 +11110,11 @@ export function createEvaluator({ evaluateElementAccessExpression, evaluateEntit
|
||||
break;
|
||||
case SyntaxKind.ElementAccessExpression:
|
||||
return evaluateElementAccessExpression(expr as ElementAccessExpression, location);
|
||||
case SyntaxKind.AsExpression:
|
||||
if (isConstTypeReference((expr as AsExpression).type)) {
|
||||
return evaluate((expr as AsExpression).expression, location);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return evaluatorResult(/*value*/ undefined, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user