RF0111: Button getter must create a Callable
The button property has a block body, setter, initializer or returns a field rather than a recognized Callable creation.
For a C# project using Reckfell.NET.Sdk 1.0.0. Fix the first build error first: later messages may be a consequence.
Cause
The button property has a block body, setter, initializer or returns a field rather than a recognized Callable creation.
Fix
Use an expression-bodied getter with Callable.From(...) or new Callable(...). Do not store the button in a backing-field auto-property.
Failing example
Save the file in a test C# project and run dotnet build. This version intentionally fails to build.
Example.cs
using Reckfell;
namespace DiagnosticExamples.RF0111;
[Tool]
public partial class Example : Entity
{
public int Count { get; private set; } = 7;
[ExportToolButton("Reset")] public Callable ResetButton { get { return Callable.From(Reset); } }
private void Reset() => Count = 0;
}Expected messages: RF0111.
Working version
Replace the failing version with these files; do not keep both declarations in the project.
Example.cs
using Reckfell;
namespace DiagnosticExamples.RF0111;
[Tool]
public partial class Example : Entity
{
public int Count { get; private set; } = 7;
[ExportToolButton("Reset")] public Callable ResetButton => Callable.From(Reset);
private void Reset() => Count = 0;
}Result
The generator recognizes the direct Callable.From(Reset) expression; calling the button resets Count.