-
-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Description
Description
The EVTC001 analyzer (introduced in 0.16.x) flags object types that aren't annotated with [EventType]. However, it fires on Eventuous's own event replay pattern — reading events from the store and folding them through State.When().
Reproduction
var events = await _eventReader.ReadEvents(stream, start, int.MaxValue, true, ct);
foreach (var evt in events) {
if (evt.Payload != null) state = state.When(evt.Payload);
// EVTC001: Event type 'object' is used as a domain event but isn't annotated with [EventType]
}ReadEvents returns StreamEvent[] where Payload is object?. The concrete event types are registered via TypeMap and resolved at deserialization time, but the static type at the call site is object — which the analyzer flags.
Expected behavior
The analyzer should not flag object when it originates from Eventuous's own StreamEvent.Payload (or similar deserialization outputs like IMessageConsumeContext.Message). These are runtime-resolved types that are inherently object-typed at the call site.
Actual behavior
- error EVTC001: Event type 'object' is used as a domain event but isn't annotated with [EventType]
- Build fails. This is a breaking change in a patch update (0.16.0 → 0.16.3).
Screenshot

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels