fix: initialize BaseEmitter in Engine constructor
The Engine struct embeds BaseEmitter but wasn't initializing it, causing a nil map panic when emitting events. Now properly initializes the BaseEmitter using emitter.New[Event]().
This commit is contained in:
@@ -17,7 +17,11 @@ type Engine struct {
|
|||||||
|
|
||||||
// Create a new engine, given an unreduced λ-expression.
|
// Create a new engine, given an unreduced λ-expression.
|
||||||
func New(config *config.Config, expression *lambda.Expression) *Engine {
|
func New(config *config.Config, expression *lambda.Expression) *Engine {
|
||||||
return &Engine{Config: config, Expression: expression}
|
return &Engine{
|
||||||
|
Config: config,
|
||||||
|
Expression: expression,
|
||||||
|
BaseEmitter: *emitter.New[Event](),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Begin the reduction process.
|
// Begin the reduction process.
|
||||||
|
|||||||
Reference in New Issue
Block a user