Both of those work correctly for me. Neither is actually using the correct syntax for the var command though. It should be:
Code:
alias badvar {
  var %a = 1,%b = $iif(%a,a,b)
  echo %b
}
which works fine too.