facebook / facebook/pyrefly

false positive bad-argument-type with dict

Open
#4,474 2 comments 1 reaction 0 assignees View on GitHub
pydantic typechecking
Dominant language
Rust
Stars
7k
Forks
516
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

NOTICE: same is value used in both `invalid()` and `valid()`.

```python
from collections.abc import Mapping
from pydantic import BaseModel
from pydantic.types import JsonValue

class EscalationChainState(BaseModel):
@classmethod
def regen_text(cls, meta: Mapping[str, JsonValue]) -> None: ...

def invalid() -> None:
meta = {"owner": {"name": "Alice"}, "zone": {"name": "B2"}}
EscalationChainState.regen_text(meta) # pyrefly: ignore [bad-argument-type]

def valid() -> None:
EscalationChainState.regen_text(
{"owner": {"name": "Alice"}, "zone": {"name": "B2"}}
)
```

possibly related to #3160

### Sandbox Link

_No response_

### (Only applicable for extension issues) IDE Information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.