What's wrong
1. The documented call form doesn't resolve inside ktsu.*
The library declares a static class DelegateTransform inside the namespace ktsu.DelegateTransform (DelegateTransform/DelegateTransform.cs:3,23). C# looks names up through the enclosing namespaces first. From code in namespace ktsu.Anything, the simple name DelegateTransform therefore resolves to the namespace ktsu.DelegateTransform, not to the class, even with using ktsu.DelegateTransform;.
using ktsu.DelegateTransform;
namespace ktsu.MyApp;
static class P { static void Main() { int r = DelegateTransform.With(5, x => x * 2); } }
- Observed:
error CS0234: The type or namespace name 'With' does not exist in the namespace 'ktsu.DelegateTransform'.
- Workaround:
ktsu.DelegateTransform.DelegateTransform.With(...) compiles and returns 10.
Every ktsu-dev consumer lives under ktsu.*, so this hits the library's main audience. The repo's own tests compile only because they sit in ktsu.DelegateTransform.Test, where the type is found first.
2. The README's "Complex Object Transformations" example needs an overload that doesn't exist
string description = DelegateTransform.With(person, p => $"{p.Name} is {p.Age} years old");
Only With<T>(T, Func<T, T>) exists (DelegateTransform.cs:50), so this gives CS0029: Cannot implicitly convert type 'string' to 'Person' and CS1662.
The fluent value.With(...).With(...) chaining described in CLAUDE.md doesn't compile either, because the methods aren't extension methods.
Suggested fix
- Make the methods extension methods:
input.With(x => …). This never names the type, so it avoids the namespace clash, and it makes the documented chaining work. Alternatively, rename the class, for example to Transform, so it no longer matches its namespace.
- Add
TResult With<T, TResult>(T input, Func<T, TResult> @delegate), with the same Ensure.NotNull check. If mapping is not intended, correct the README example instead.
- Add a test project, or at least one test file, in a namespace outside
ktsu.DelegateTransform (for example ktsu.Consumer) that compiles the README examples, so the clash can't come back.
What's wrong
1. The documented call form doesn't resolve inside
ktsu.*The library declares a static class
DelegateTransforminside the namespacektsu.DelegateTransform(DelegateTransform/DelegateTransform.cs:3,23). C# looks names up through the enclosing namespaces first. From code innamespace ktsu.Anything, the simple nameDelegateTransformtherefore resolves to the namespacektsu.DelegateTransform, not to the class, even withusing ktsu.DelegateTransform;.error CS0234: The type or namespace name 'With' does not exist in the namespace 'ktsu.DelegateTransform'.ktsu.DelegateTransform.DelegateTransform.With(...)compiles and returns 10.Every ktsu-dev consumer lives under
ktsu.*, so this hits the library's main audience. The repo's own tests compile only because they sit inktsu.DelegateTransform.Test, where the type is found first.2. The README's "Complex Object Transformations" example needs an overload that doesn't exist
Only
With<T>(T, Func<T, T>)exists (DelegateTransform.cs:50), so this givesCS0029: Cannot implicitly convert type 'string' to 'Person'andCS1662.The fluent
value.With(...).With(...)chaining described in CLAUDE.md doesn't compile either, because the methods aren't extension methods.Suggested fix
input.With(x => …). This never names the type, so it avoids the namespace clash, and it makes the documented chaining work. Alternatively, rename the class, for example toTransform, so it no longer matches its namespace.TResult With<T, TResult>(T input, Func<T, TResult> @delegate), with the sameEnsure.NotNullcheck. If mapping is not intended, correct the README example instead.ktsu.DelegateTransform(for examplektsu.Consumer) that compiles the README examples, so the clash can't come back.