Repository navigation
Description
Package
CodoMetis.TypeKit.Generators
Version
2.3.0, and every release that generates these members
How does it fail?
Silently for IMinMaxValue; for the others a Metalama error (LAMA0500) naming nothing you wrote
What you ran
A base record implements a member the generators implement, publicly:
public abstract record LocalBoundedBase<TSelf> : IMinMaxValue<TSelf> where TSelf : LocalBoundedBase<TSelf>, IMinMaxValue<TSelf>
{
public static TSelf MaxValue => throw new NotSupportedException("base");
public static TSelf MinValue => throw new NotSupportedException("base");
}
public sealed partial record LocalLevel : LocalBoundedBase<LocalLevel>, IValue<int>;
LocalLevel.MaxValue; // throws "base": the generated MaxValue is not there
Max<LocalLevel>(); // throws "base"
public abstract record FormattingBase : IFormattable
{
public string ToString(string? format, IFormatProvider? formatProvider) => "base";
}
public sealed partial record Shown : FormattingBase, IValue<int>; // LAMA0500What you got
Measured on release/2.4.0 at 97c87c1, 2026-10-30, the base in the same project:
IMinMaxValue: the base's public staticMaxValueandMinValueare the value object's; noMaxValueis generated and nothing is reported. A hand-writtenMaxValueon the value object itself is CMTK1011.IFormattable.ToString(string?, IFormatProvider?),IComparable.CompareTo(object),IParsable<TSelf>.Parse/TryParse: LAMA0500, "cannot introduce member ... because it is already defined in type ...".
From another project, the base's public static members are refused already, but described as "the explicit implementation of ...": the compiler records any implementation of a static abstract member as explicit in metadata. A closed set's base class from another project with an explicit IClosedSet<TSelf> implementation is #191's case, refused by #193.
What you expected
CMTK1011 (CMTK1008 for comparison) naming the base's member, as a base record's members count as the value object's own (decision 28), and an error that says "BoundedPublicBase.MaxValue in its base type ...", not "explicit implementation". Found by variant analysis while checking an outside review of #193.
Environment
.NET SDK 10.0.4xx, Metalama 2026.1; any consumer.
Scope as fixed in #193 (38b316f)
Measured beyond the report: a base record's public Value, From and TryFormat failed the aspect the same way (LAMA0500), and its static MinValue/MaxValue without IMinMaxValue were the value object's as well. All are CMTK1011 now (CMTK1008 for CompareTo(object)), naming the base's member by its own name, including a public static one from another project, which no longer reads "the explicit implementation of …". The interface mapping refuses a base's public implementation of a generated interface's member, and the names and signatures checked on the value object are checked on each base record. A base's TryFrom, a seam, is #194's. Decision 124 records it.
Activity
fix: refuse a base record's public generated member and name a public…
fix: refuse a base record's public generated member and name a public…
CaffeinatedCoder commentedon Oct 30, 2026
Fixed by #201, merged into
release/2.3.1as 8fac39b; ships in 2.3.1.