Issue 24: parent double colon handling

two commits:

* fix for issue #24
* follow up commit to avoid endless loop on illegal class hierarchy cycles

feel free to consider the last commit as too exotic