fix #696 substitute aliases in param and arg type before inferring