diff --git a/CHANGELOG.md b/CHANGELOG.md index 13caa2c20a0c3d2d2ad88dda56f08171a103a8cb..179308ea60b21f733c6274f007e12af22c8f13ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,4 +3,6 @@ * minor pylint improvements * better coverage * SyncableDroppable.cleanup() bugs out, wrote a quick patch for it to do nothing and filed as #61. -* unit tests for overloading \ No newline at end of file +* unit tests for overloading +* fixed #60 + diff --git a/tests/test_coding/test_overloading.py b/tests/test_coding/test_overloading.py index be72a045f1682bba42b0a027ed23a40bc31cceb5..c189ff59909513e81969b15c25cc8539b37853a5 100644 --- a/tests/test_coding/test_overloading.py +++ b/tests/test_coding/test_overloading.py @@ -25,3 +25,21 @@ class TestOverloading(unittest.TestCase): fun(2) self.assertRaises(TypeError, lambda: fun(2.5)) fun('test') + + def test_something_2(self): + class A: + pass + + class B(A): + pass + + @overload + def fun(a: B): + self.assertEquals(type(a), B) + + @fun.overload + def fun(a: A): + self.assertEquals(type(a), A) + + fun(A()) + fun(B())