---
source: crates/red_knot_test/src/lib.rs
expression: snapshot
---
---
mdtest name: invalid_argument_type.md - Invalid argument type diagnostics - Calls to methods
mdtest path: crates/red_knot_python_semantic/resources/mdtest/diagnostics/invalid_argument_type.md
---

# Python source files

## mdtest_snippet.py

```
1 | class C:
2 |     def square(self, x: int) -> int:
3 |         return x * x
4 | 
5 | c = C()
6 | c.square("hello")  # error: [invalid-argument-type]
```

# Diagnostics

```
error: lint:invalid-argument-type: Argument to this function is incorrect
 --> /src/mdtest_snippet.py:6:10
  |
5 | c = C()
6 | c.square("hello")  # error: [invalid-argument-type]
  |          ^^^^^^^ Expected `int`, found `Literal["hello"]`
  |
info: Function defined here
 --> /src/mdtest_snippet.py:2:9
  |
1 | class C:
2 |     def square(self, x: int) -> int:
  |         ^^^^^^       ------ Parameter declared here
3 |         return x * x
  |

```
