mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
[ty] Fix Inconsistent casing in diagnostic (#18084)
This commit is contained in:
parent
8cbd433a31
commit
d17557f0ae
9 changed files with 16 additions and 16 deletions
|
@ -194,7 +194,7 @@ def good_return(x: T) -> T:
|
|||
return x
|
||||
|
||||
def bad_return(x: T) -> T:
|
||||
# error: [invalid-return-type] "Return type does not match returned value: Expected `T`, found `int`"
|
||||
# error: [invalid-return-type] "Return type does not match returned value: expected `T`, found `int`"
|
||||
return x + 1
|
||||
```
|
||||
|
||||
|
@ -212,7 +212,7 @@ def different_types(cond: bool, t: T, s: S) -> T:
|
|||
if cond:
|
||||
return t
|
||||
else:
|
||||
# error: [invalid-return-type] "Return type does not match returned value: Expected `T`, found `S`"
|
||||
# error: [invalid-return-type] "Return type does not match returned value: expected `T`, found `S`"
|
||||
return s
|
||||
|
||||
def same_types(cond: bool, t1: T, t2: T) -> T:
|
||||
|
|
|
@ -179,7 +179,7 @@ def good_return[T: int](x: T) -> T:
|
|||
return x
|
||||
|
||||
def bad_return[T: int](x: T) -> T:
|
||||
# error: [invalid-return-type] "Return type does not match returned value: Expected `T`, found `int`"
|
||||
# error: [invalid-return-type] "Return type does not match returned value: expected `T`, found `int`"
|
||||
return x + 1
|
||||
```
|
||||
|
||||
|
@ -192,7 +192,7 @@ def different_types[T, S](cond: bool, t: T, s: S) -> T:
|
|||
if cond:
|
||||
return t
|
||||
else:
|
||||
# error: [invalid-return-type] "Return type does not match returned value: Expected `T`, found `S`"
|
||||
# error: [invalid-return-type] "Return type does not match returned value: expected `T`, found `S`"
|
||||
return s
|
||||
|
||||
def same_types[T](cond: bool, t1: T, t2: T) -> T:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue