Skip to content

Issue with temporal-sdk that succeeded with other type checker #3085

Description

@evan-sadler

Describe the Bug

I noticed that pyrefly threw this error when mypy did not. I'm not sure if it's a false positive or an issue, but wanted to surface!

  ⎿  Error: Exit code 1                                     
     Using CPython 3.11.13                                                                                                                                                      
     Creating virtual environment at: .venv                                                                                                                                     
     Installed 12 packages in 87ms                                                                                                                                              
     ERROR Argument `type[str]` is not assignable to parameter `type_hint` with type `type[TypeVar[AnyType]]` in function                                                       
     `temporalio.converter._payload_converter.PayloadConverter.from_payload` [bad-argument-type]
       --> src/repro_payload.py:15:45                                                                                                                                           
        |                                                                                                                                                                     
     15 |     value = converter.from_payload(payload, str)                                                                                                                      
        |                                             ^^^
        |                                                                                                                                                                       
     … +2 lines (ctrl+o to see all)   

see project pyrefly-temporal-repro.zip

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions