add more asserts for casts
Merge branch 'master' of github.com:JuliaLang/julia