Object of class `FunctionType` has no attribute `return_value` [missing-attribute]
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
in pytest env, we can set .return_value to change the return value.
https://github.com/langgenius/dify/pull/39876/changes#diff-11f51968a981aae553847d0824bf7e3f0750f5c1145432e57ec7c55eb727b216L157
But this causes some false positive.
### Sandbox Link
_No response_
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Research direction
Start with the linked Dify pull-request diff, especially the referenced line, and reproduce the `FunctionType.return_value` diagnostic in a pytest environment. Trace why Pyrefly treats this assignment as a missing attribute and verify that the false positive is no longer reported without weakening valid diagnostics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100