Fix for #1431: type(tuple.rest)

Always cast when we cannot trust the type
Updated test .src for #1431: type(tuple.rest)

We generate a bit more casts
Test for #1431: type(tuple.rest)