fix #650, disallow refs to uninstantiable types