mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-25989 PY-84544 Widen types during type parameters substitution
(cherry picked from commit 627673fc7ed27621df839a5c1d4d31e677ce7f8c) GitOrigin-RevId: 07803c6243370d55df0d870e2e32b38170c1fb49
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a1e73e339b
commit
241ba26253
@@ -40,7 +40,11 @@ def test():
|
||||
print(result)
|
||||
print(result + <warning descr="Expected type 'int', got 'str' instead">'foo'</warning>)
|
||||
|
||||
f2(1, <warning descr="Expected type 'List[int]' (matched generic type 'List[T]'), got 'List[str]' instead">['foo']</warning>, 'bar')
|
||||
# Bug: Expected error.
|
||||
# Generics are considered to be covariant.
|
||||
# I.e. `list[str]` is assignable to `list[int | str]`.
|
||||
# Thus, substitution `T` -> `int | str` is considered valid.
|
||||
f2(1, ['foo'], 'bar')
|
||||
|
||||
result = f3(1, 'foo', True)
|
||||
f4(<warning descr="Expected type 'Tuple[bool, int, str]', got 'Tuple[int, str, bool]' instead">result</warning>)
|
||||
|
||||
Reference in New Issue
Block a user