mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Implement matching types against protocols (PY-26628)
Update PyTypeChecker to prevent recursion while matching types. SOE was received while matching `self` parameters for methods inside protocol and other class.
This commit is contained in:
@@ -470,4 +470,44 @@ public class PyTypeCheckerInspectionTest extends PyInspectionTestCase {
|
||||
public void testModuleWithGetAttr() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON37, this::doMultiFileTest);
|
||||
}
|
||||
|
||||
// PY-26628
|
||||
public void testAgainstTypingProtocol() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON35, this::doTest);
|
||||
}
|
||||
|
||||
// PY-26628
|
||||
public void testAgainstTypingProtocolWithImplementedMethod() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON35, this::doTest);
|
||||
}
|
||||
|
||||
// PY-26628
|
||||
public void testAgainstTypingProtocolWithImplementedVariable() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON36, this::doTest);
|
||||
}
|
||||
|
||||
// PY-26628
|
||||
public void testAgainstMergedTypingProtocols() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON35, this::doTest);
|
||||
}
|
||||
|
||||
// PY-26628
|
||||
public void testAgainstGenericTypingProtocol() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON36, this::doTest);
|
||||
}
|
||||
|
||||
// PY-26628
|
||||
public void testAgainstRecursiveTypingProtocol() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON35, this::doTest);
|
||||
}
|
||||
|
||||
// PY-26628
|
||||
public void testAgainstTypingProtocolWrongTypes() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON36, this::doTest);
|
||||
}
|
||||
|
||||
// PY-26628
|
||||
public void testTypingProtocolAgainstProtocol() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON36, this::doTest);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user