cafPdmScripting_UnitTests, on the mock folder hierarchy:
- SkipsTypedOverrideWithSameTypeAsSuperClass: a subclass with the same
narrowed type as its super class gets no second override (the
EnsembleSurface case, so far only covered by pytest), and a subclass
that does not narrow gets none either.
- ReportsTypedOverrideThatIsNotASubclassOfDeclaredType: a narrowed type
outside the declared type's hierarchy adds exactly one entry to
errorMessages and no override.
The generator skipped the typed override only when the direct super
class reported the same return type, and an abstract super class such
as RimPolygonContainer is never instantiated, so the check was skipped
there. It now walks up from the direct super class to the class the
method is registered on and stops at the nearest instantiable ancestor
whose type narrows; the override is skipped when that ancestor already
declares the same type.
The ancestor's type is taken from its dummy object, not from
classMethodsGenerated: the sort of the dummy objects does not order a
class before a subclass whose keyword sorts first (SurfaceCollection and
EnsembleSurface compare equal there), so the ancestor's override may not
be generated yet.
cafPdmScripting_UnitTests: a mock folder hierarchy with an abstract
class between a typed class and a subclass of the same type; the
subclass gets no second override.
The Python generator emits add_folder() again on a concrete collection
class when the folder type narrows: SurfaceCollection.add_folder()
returns SurfaceCollection and PolygonCollection.add_folder() returns
PolygonCollection, while PdmNestedCollectionBase keeps the declared type.
PdmObjectMethod::classKeywordReturnedTypeForSelf() reports the narrowed
type, and the super class method check in the generator accepts such an
override (same arguments, subclass return type).
PdmNestedCollectionBase: subCollectionClassKeyword() names the folder
type without creating one, addNewSubCollection() is a template method
over createSubCollection() and returns PdmNestedCollectionBase*, and the
base virtuals are pure. The leaf polygon containers only override
canAddSubCollection().
collection_name() in rips returns the folder name for every nested
collection; the class specific name attributes are kept.