Add test for child of specialised generic

This commit is contained in:
Peter Law
2020-03-18 22:15:32 +00:00
parent 0f8e7b453e
commit 95b0cdcb5e

View File

@@ -223,6 +223,21 @@ first(specialised_instance)
values(specialised_instance)[0]
# Test that classes which have gneeric ancestry but neither they nor their
# parents are not generic are still inferred correctly.
class ChildOfSpecialised(Specialised):
pass
child_of_specialised_instance = NotImplemented # type: ChildOfSpecialised
#? int()
first(child_of_specialised_instance)
#? str()
values(child_of_specialised_instance)[0]
# Test that unbound generics are inferred as much as possible
class CustomPartialGeneric1(Mapping[str, T]):
pass