core: check results of data constructors match enclosing data type