Summary
Hi! Migrating from pyright to ty, stumbling upon function name shadowing the type available in the outer scope, see below - it results in an error and function returns Unknown instead of declaration.
class declaration:
...
class A:
# Function `declaration` is not valid in a return type annotation (invalid-type-form) [Ln 5, Col 30]
def declaration(self) -> declaration: ...
# `a` is `Unknown`
a = A().declaration()
Playground
Code sample in pyright playground
Version
0.0.40
Summary
Hi! Migrating from
pyrighttoty, stumbling upon function name shadowing the type available in the outer scope, see below - it results in an error and function returnsUnknowninstead ofdeclaration.Playground
Code sample in pyright playground
Version
0.0.40