Skip to content
Shiny.NET

Build Diagnostics

The source generator checks your actors as you build, so mistakes surface in the IDE instead of at runtime.

Code
SACT001 An interface member can’t be proxied (a property, a generic method, or ref/out/in parameters)
SACT002 A method doesn’t return Task, Task<T>, ValueTask or ValueTask<T>
SACT003 A [OneWay] method returns a value
SACT004 A class implements an actor interface but doesn’t derive from Actor
SACT005 An actor can’t be constructed (it’s generic, private, or has ambiguous constructors)
SACT006 Warning: two classes implement one interface. Pick one with actors.AddActor<IFoo, Foo>()
SACT007 Warning: a state or event type (Actor<T>, JournaledActor<,>, [ActorState]) isn’t on any JsonSerializerContext
SACT008 An actor interface is generic or not reachable
SACT009 Two actors share an [ActorName]
SACT010 An [ActorState] parameter isn’t an IActorState<T>
SACT011 A [StatelessWorker] has persistent state (Actor<T>, JournaledActor<,> or [ActorState])
SACT012 Two methods of an interface get the same wire key: Foo(int) and Foo(int, CancellationToken), or Foo() inherited from two interfaces
SACT013 Two actor interfaces have the same wire name ([ActorName])
SACT014 Warning: a [OneWay] method takes a CancellationToken, which it never observes
SACT015 Info: a parameter or return type isn’t on any JsonSerializerContext in the project, so remote calls with it fail. Only types from this project are checked

For each actor interface, it writes a local proxy, a remote proxy and a wire contract. For each class, it writes a registration. A single module initializer wires all of it up, which is why AddShinyActors() needs no list of actors and nothing is found by reflection.