mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-12 23:36:28 -05: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