Fix nested Annotated calls not resolving

This commit is contained in:
Rapptz
2022-08-17 10:38:12 -04:00
parent 8dd186cf1e
commit 1c7747fe9d
7 changed files with 70 additions and 18 deletions

View File

@ -1062,6 +1062,11 @@ def evaluate_annotation(
cache[tp] = evaluated
return evaluated
if hasattr(tp, '__metadata__'):
# Annotated[X, Y] can access Y via __metadata__
metadata = tp.__metadata__[0]
return evaluate_annotation(metadata, globals, locals, cache)
if hasattr(tp, '__args__'):
implicit_str = True
is_literal = False