MIND-Tools/mind-compiler — pull request #12 by StephaneSeyvoz (2013-12-04 18:03:51+00:00)
Title: Itf inheritance cast

Feature/bugfix: Bindings using type-hierarchy-related interfaces now have C cast generated where needed.

Pre-requisite:
- Accepting Pull Requests https://github.com/MIND-Tools/mind-compiler/pull/8 and then https://github.com/MIND-Tools/mind-compiler/pull/11 (11 is already dependending on https://github.com/MIND-Tools/mind-compiler/pull/8) ; contribution should then be reduced to commit b3dde39fde713d4c63fd778c4c30ee7e822a70db

Issue: used to be that C compilers would raise a warning on pointer casts when trying to initialize a binding from an I1 interface type struct with an I2 destination interface, where I2 extends I1.

Solution: Detection on binding check and tag the according AST interface/binding nodes to add the necessary cast with StringTemplates.