mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 07:55:56 +03:00
Fixed a crashing bug that results from an internal assertion failure when a generic class that uses PEP 695 syntax is located within an unreachable code block. This addresses #7828.
This commit is contained in:
parent
66ebc186e1
commit
bdc4b2650f
@ -17132,10 +17132,9 @@ export function createTypeEvaluator(
|
||||
function evaluateTypeParameterList(node: TypeParameterListNode): TypeVarType[] {
|
||||
const paramTypes: TypeVarType[] = [];
|
||||
const typeParamScope = AnalyzerNodeInfo.getScope(node);
|
||||
assert(typeParamScope !== undefined);
|
||||
|
||||
node.parameters.forEach((param) => {
|
||||
const paramSymbol = typeParamScope.symbolTable.get(param.name.value);
|
||||
const paramSymbol = typeParamScope?.symbolTable.get(param.name.value);
|
||||
if (!paramSymbol) {
|
||||
// This can happen if the code is unreachable.
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user