Revert "removed unnescessary structural typing hack"

This reverts commit 3e5940efb759dbe9c694e7a16d113dad1505cc55.