When you use if as an expression like var res = if cond: x else: y Run
the x and y have to have the same type. Seems to be obvious in a statically type language, but I think I will add a note in my book.
When you use if as an expression like var res = if cond: x else: y Run
the x and y have to have the same type. Seems to be obvious in a statically type language, but I think I will add a note in my book.