mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Add a test covering another scenario broken due to implementation of getReceiver()
used in PyiTypeProvider. That was fixed in 8eda017f0f
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
from lib import MyClass
|
||||
|
||||
ex<caret>pr = 42 < MyClass(42) < MyClass('foo')
|
||||
@@ -0,0 +1,9 @@
|
||||
class MyClass:
|
||||
def __init__(self, *args):
|
||||
pass
|
||||
|
||||
def __lt__(self, other):
|
||||
pass
|
||||
|
||||
def __gt__(self, other):
|
||||
return True
|
||||
@@ -0,0 +1,19 @@
|
||||
from typing import overload, Generic, TypeVar
|
||||
|
||||
T = TypeVar('T')
|
||||
|
||||
|
||||
class MyClass(Generic[T]):
|
||||
def __init__(self, x: T):
|
||||
pass
|
||||
|
||||
@overload
|
||||
def __lt__(self, other: MyClass) -> T:
|
||||
pass
|
||||
|
||||
@overload
|
||||
def __lt__(self, other: str) -> bool:
|
||||
pass
|
||||
|
||||
def __gt__(self, other: int) -> bool:
|
||||
pass
|
||||
@@ -142,4 +142,8 @@ public class PyiTypeTest extends PyTestCase {
|
||||
public void testGenericClassDefinitionInSameFile() {
|
||||
doTest("int");
|
||||
}
|
||||
|
||||
public void testComparisonOperatorOverloads() {
|
||||
doTest("int");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user