On Wed, Dec 14, 2016 at 06:07:48PM +0100, Paolo Bonzini wrote: > > > On 14/12/2016 14:48, Eduardo Habkost wrote: > >> How do you find all abstract TypeInfo in the source? The uninitiated > >> might grep for .abstract = true, and be misled. The initiated will be > >> annoyed instead, because grepping for *absence* of .instance_size = is > >> bothersome. > >> > >> I suspect life could be easier going forward if we instead required > >> .abstract = true for interfaces, and enforced it with > >> assert(ti->instance_size || ti->abstract) here. > > I was doing that before deciding to change type_initialize(). I > > think I still have the commit in my git reflog, I will recover it > > and submit it as v3. > > I think it's worse. > > Interfaces are abstract by definition. Requiring ".abstract = true" > makes things less intuitive. v2 seems good.
I don't think that making the type declaration more explicit would cause any real problems, and it would help people grepping the code. Anybody forgetting to add .abstract=true to new interfaces would immediatly see an assertion error and would just be annoyed for 1 minute. I will submit v3 and let the maintainers decide. -- Eduardo