@@ -1927,22 +1927,21 @@ def _check_consumer(
19271927
19281928 # Skip postponed evaluation of annotations
19291929 # and unevaluated annotations inside a function body
1930+ # as well as TypeAlias nodes.
19301931 if not (
1931- self ._postponed_evaluation_enabled
1932+ self ._postponed_evaluation_enabled # noqa: RUF021
19321933 and (
19331934 isinstance (stmt , nodes .AnnAssign )
1934- or (
1935- isinstance (stmt , nodes .FunctionDef )
1936- and node
1937- not in {
1938- * (stmt .args .defaults or ()),
1939- * (stmt .args .kw_defaults or ()),
1940- }
1941- )
1935+ or isinstance (stmt , nodes .FunctionDef ) # noqa: RUF021
1936+ and node
1937+ not in {
1938+ * (stmt .args .defaults or ()),
1939+ * (stmt .args .kw_defaults or ()),
1940+ }
19421941 )
1943- ) and not (
1944- isinstance (stmt , nodes .AnnAssign )
1942+ or isinstance (stmt , nodes .AnnAssign ) # noqa: RUF021
19451943 and utils .get_node_first_ancestor_of_type (stmt , nodes .FunctionDef )
1944+ or isinstance (stmt , nodes .TypeAlias )
19461945 ):
19471946 self .add_message (
19481947 "used-before-assignment" ,
@@ -2018,7 +2017,7 @@ def _report_unfound_name_definition(
20182017 if (
20192018 self ._postponed_evaluation_enabled
20202019 and utils .is_node_in_type_annotation_context (node )
2021- ):
2020+ ) or utils . is_node_in_pep695_type_context ( node ) :
20222021 return False
20232022 if self ._is_builtin (node .name ):
20242023 return False
0 commit comments