type: improve handling of type promotion on binary operations