---
source: crates/ty_test/src/lib.rs
expression: snapshot
---
---
mdtest name: invalid_argument_type.md - Invalid argument type diagnostics - Tests for a variety of argument types - Variadic arguments
mdtest path: crates/ty_python_semantic/resources/mdtest/diagnostics/invalid_argument_type.md
---

# Python source files

## mdtest_snippet.py

```
1 | def foo(*numbers: int) -> int:
2 |     return len(numbers)
3 | 
4 | foo(1, 2, 3, "hello", 5)  # error: [invalid-argument-type]
```

# Diagnostics

```
error[invalid-argument-type]: Argument to function `foo` is incorrect
 --> src/mdtest_snippet.py:4:14
  |
2 |     return len(numbers)
3 |
4 | foo(1, 2, 3, "hello", 5)  # error: [invalid-argument-type]
  |              ^^^^^^^ Expected `int`, found `Literal["hello"]`
  |
info: Function defined here
 --> src/mdtest_snippet.py:1:5
  |
1 | def foo(*numbers: int) -> int:
  |     ^^^ ------------- Parameter declared here
2 |     return len(numbers)
  |
info: rule `invalid-argument-type` is enabled by default

```
