Skip to content

[BUG] Incorrect calculating a sequence of generated flows. #12

@ximyro

Description

@ximyro

Example

func Joo()  error{
   effe.BuildFlow(
       effe.Step(doSomething),
   )
  return nil
}

func Boo() error {
 effe.BuildFlow(
   effe.Step(Joo),
 )
 return  nil
}

func Foo() error {
  effe.BuildFlow(
    effe.Step(Boo),
    effe.Step(Boo), // Error will here
 )
 return nil
}

It triggers an error because the analyzer ignores dependencies for the component Boo because it has already added it to a sequence.

The sequence of dependencies will look like: [Boo, Joo, Boo]

 effe: failed generate: function Boo has the incorrect format: return value should be a function

_, ok := a.visited[a.flowDecls[flowDeclIndex].flowFunc.Name.Name]
if ok {
continue

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions