Duplicate definitions due to recursion through inheritance tree