mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-19 04:07:36 +03:00
Allow comment-based type annotations to use forward references without using string literals.
This commit is contained in:
parent
5bb39c8a71
commit
3c182c523d
@ -934,6 +934,11 @@ export function createTypeEvaluator(importLookup: ImportLookup, printTypeFlags:
|
||||
evaluatorFlags |= EvaluatorFlags.AllowForwardReferences;
|
||||
}
|
||||
|
||||
// If the annotation is part of
|
||||
if (node?.parent?.nodeType === ParseNodeType.Assignment && node.parent.typeAnnotationComment === node) {
|
||||
evaluatorFlags |= EvaluatorFlags.AllowForwardReferences;
|
||||
}
|
||||
|
||||
if (!allowFinal) {
|
||||
evaluatorFlags |= EvaluatorFlags.FinalDisallowed;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user