Closed
Description
This example started generating a false positive about an undefined name (simplified from a real-world generated protobuf stubs):
from typing import NewType
class W[T]: pass
class R:
class M(W[Action.V], type): # Name "Action.V" is not defined
FOO = R.Action.V(0)
class Action(metaclass=M):
V = NewType('V', int)
class Action:
pass
This was a side effect of #18625.
There may be some confusion between R.Action
and Action
classes.
This looks like a release blocker. This is happening in generated protobuf stubs code which can't be edited easily.
If this is non-trivial to fix, we could temporarily revert the original PR until a fix is available.
cc @ilevkivskyi as the author of the above PR