Setting type before checking assertion