Skip to content

Feature/property system aliases

Timo Koch requested to merge feature/property-system-aliases into master

A new feature for the property system. Properties can now be "specialized" by creating an alias with the same name as a member of the type tag we would usually specialize for. This allows for a more terse notation.

Theoretically, this can replace all specializations. The only thing that specialization can do in addition is defining custom members apart from type/value that can be also extracted, but we hardly use that anywhere.

In particular, this is proposed to be useful for high-level test-level property definitions. For default (models, discretization) specialization is preferred as more explicit. In particular one would be tempted to use other alias members of the same type tag to set properties. However, this would break the inheritance (at least in case some inherits from this typetag and overwrite the property that is the dependency). For the inheritance to work one has to use GetProp for such and template aliases for such cases. (This works with aliases as well, it's just easier to forget because it looks like you have direct access to the other types) Naturally, this isn't a problem on the user level / leaf of inheritance, so there you can use the tersest syntax.

I added a test demonstrating how it works (based on the existing test). Also !3380 (merged) shows how this looks in application code.

Edited by Timo Koch

Merge request reports