fix Issue 11822 -  switch causees ICE with  return and other stuff
Set DWARF Version: 3 in .debug_info section
Merge pull request #3087 from ibuclaw/dwarfv3

Set DWARF Version: 3 in .debug_info section
Merge pull request #3081 from WalterBright/fix11822

fix Issue 11822 -  switch causes ICE with  return and other stuff
More better error propagation with TypeFunction

`TypeFunction` is also used for the extra payload of function attributes.
Therefore, even if function signature or its body has errors, we would be better to leave that `fd->type->ty == Tfunction`.
fix-up test cases for issue 11822, 11850, and 11857