mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
Allow const assertions in constant expressions
This commit is contained in:
parent
d7ff565b6c
commit
e0036e65e8
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user