On 11/09/2015 12:11 PM, Markus Armbruster wrote:
> Eric Blake <ebl...@redhat.com> writes:
> 
>> On 11/09/2015 06:00 AM, Markus Armbruster wrote:
>>> Eric Blake <ebl...@redhat.com> writes:
>>>
>>>> Consolidate two common sequences of clash detection into a
>>>> new QAPISchemaObjectType.check_clash() helper method.
>>>>
>>>> No change to generated code.
>>>>
>>>> Signed-off-by: Eric Blake <ebl...@redhat.com>

>>>> @@ -980,11 +980,7 @@ class QAPISchemaObjectType(QAPISchemaType):
>>>>          seen = OrderedDict()
>>>>          if self._base_name:
>>>>              self.base = schema.lookup_type(self._base_name)
>>>> -            assert isinstance(self.base, QAPISchemaObjectType)
>>>
>>> This assertion is lost.
>>>

>>
>> Directly lost, but indirectly still present.  The new code is calling
>> QAPISchemaObjectType.check_clash(), which won't exist unless self.base
>> is a QAPISchemaObjectType.
> 
> or a QAPISchemaObjectTypeMember, or a QAPISchemaObjectVariants, or
> whatever else acquires the method in the future.
> 

> 
> Maybe, but the isinstance(self.base, QAPISchemaObjectType) will come
> right back anyway when we move the "'base' for FOO cannot use BAR type"
> check from the old semantic analysis into the check methods.  Until
> then, it makes sense at least as a place holder.

Good point, I'll add it back in.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to