Skip to content

Pyrefly internal-error, missing attribute on type Self #2250

@HEROgold

Description

@HEROgold

Describe the Bug

See the sandbox link: variable y is correctly determined to be y: Self@SomeClass, however variable x on return shows x: Self Returned type 'Self' is not assignable to declared return type 'Self@SomeClass'
When using generics, and retrieving Self from some form of cache, pyrefly loses some context about Self and throws this Error:

TODO: bool attribute base undefined for type: Self (trying to access bool)
Sorry, Pyrefly encountered an internal error, this is always a bug in Pyrefly itself
Please report the bug at https://github.com/facebook/pyrefly/issues/new
Pyreflyinternal-error`

version: Pyrefly 0.50.0

Sandbox Link

https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeS4ATrgLYAEALqcROgOZ0Q3G6UN0BlGFDAAddOIDGUVHDiDaMAMIy5icXU11JqSQAsYdALx1MESQwDarBgBpBwsAF0AFAEpxGrZhhg6bGAYAfVY4BgxJGBc4Rzc6AFoAPgcRdXQtDM4-fDpEExiRQh19GEsABicvTMzKQIBXSnT8KsyIP1Jc-Mc06urahgb00haMmjgOE1EQADlcTnQwiMMwXDqsKZGtSlQIGLoANVQoOpgAUUpqShcxtg90EFsQOoZoOBJyRBAAYjoAVReoBAmHQwGsLBBcAtPFhfCDeDRUMF0HUaNgYFd8Ih5gw4kk6GFKD0tvVGiCptMUWjCXRgPgAL4be6PMi1MBQUiEBi0KAUH4ABVIrPZ%2BIwOAI2khkDYDUREPQhHEPyEhj0DAYxDgiAA9FqWb52YReGwtTB0FrMLhJHAtZJJRBpdsXpCtXDKHRUAA3HYybCwCXoKUyp3pXDEYNvcRkBh6SHxD3ouBy4x0KYAZkIAEYAEyMkB0x66F7xgBi0BgFDQWDwRDIeaAA

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions