[ty] Fix Inconsistent casing in diagnostic (#18084)

This commit is contained in:
Chandra Kiran G 2025-05-14 11:56:48 +05:30 committed by GitHub
parent 8cbd433a31
commit d17557f0ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 16 additions and 16 deletions

View file

@ -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:

View file

@ -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: