Re: [PATCH 07/16] qapi/expr.py: Add casts in a few select cases

2020-09-24 Thread Cleber Rosa
On Tue, Sep 22, 2020 at 05:13:04PM -0400, John Snow wrote: > Casts are instructions to the type checker only, they aren't "safe" and > should probably be avoided in general. In this case, when we perform > type checking on a nested structure, the type of each field does not > "stick". > > We

Re: [PATCH 07/16] qapi/expr.py: Add casts in a few select cases

2020-09-23 Thread Eduardo Habkost
On Tue, Sep 22, 2020 at 05:13:04PM -0400, John Snow wrote: > Casts are instructions to the type checker only, they aren't "safe" and > should probably be avoided in general. In this case, when we perform > type checking on a nested structure, the type of each field does not > "stick". > > We

[PATCH 07/16] qapi/expr.py: Add casts in a few select cases

2020-09-22 Thread John Snow
Casts are instructions to the type checker only, they aren't "safe" and should probably be avoided in general. In this case, when we perform type checking on a nested structure, the type of each field does not "stick". We don't need to assert that something is a str if we've already checked that