Skip to content

Commit

Permalink
Fixed bug in handling of "cast" function when type is specified withi…
Browse files Browse the repository at this point in the history
…n a string literal.
  • Loading branch information
msfterictraut committed Feb 15, 2020
1 parent 8e1bf2b commit d379117
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions server/src/analyzer/typeEvaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3239,12 +3239,14 @@ export function createTypeEvaluator(importLookup: ImportLookup): TypeEvaluator {
errorNode);
}
}
}

type = validateCallArguments(errorNode, argList, functionType,
new TypeVarMap(), skipUnknownArgCheck).returnType;
if (!type) {
type = UnknownType.create();
type = convertClassToObject(castToType);
} else {
type = validateCallArguments(errorNode, argList, functionType,
new TypeVarMap(), skipUnknownArgCheck).returnType;
if (!type) {
type = UnknownType.create();
}
}
} else {
const exprString = ParseTreeUtils.printExpression(errorNode);
Expand Down

0 comments on commit d379117

Please sign in to comment.