A strategy that decides whether the framework should generate an additional forwarding constructor
when IntroduceParameter(IConstructor, string, IType, IPullStrategy?, ImmutableArray<AttributeConstruction>, IConstructorOverloadingStrategy?)
mutates a constructor with a required parameter. A forwarding constructor is a compile-time stub that keeps
the pre-mutation signature callable and chains via : this(...) to the now-mutated constructor,
preserving both source and binary compatibility. For the standard implementation see
ConstructorOverloadingStrategy.
Namespace: Metalama.Framework.Advising
Assembly: Metalama.Framework.dll
Syntax
public interface IConstructorOverloadingStrategy : ICompileTimeSerializableRemarks
Cross-Project Operation: Overloading strategies operate across project boundaries. Custom implementations must be serializable because the strategy is persisted in the transitive advice metadata and invoked again in projects that reference the project where the parameter was introduced. For example, when a parameter is introduced on a base-class constructor in project A and a derived class in project B has its constructor mutated as a result of the pull walk, the same overloading strategy decides whether project B's derived constructor should also receive a forwarding constructor.
Methods
| Name | Description |
|---|---|
| GetConstructorOverloadingAction(IConstructor, IParameter) | Gets the action the framework should apply when a constructor has just been mutated: generate a forwarding constructor (optionally decorated with ObsoleteAttribute), or do nothing. |