Resolve names in if-else statement