more thorough checking of type alias parameters. fixes #3601