Skip to content

wrap with Effect.gen rewrite is suggested in impossible/inappropriate contexts #391

@nikelborm

Description

@nikelborm

What steps can reproduce the bug?

  1. Create a file with the following code

    import { Effect } from 'effect'
    
    export class Asd extends Effect.Service<Asd>()("Asd", {
      succeed: {}
    }) {}
  2. Set the mouse cursor at Service

  3. Press Ctrl + . in VS Code

  4. Apply Wrap with Effect.gen rewrite

What is the expected behavior?

The option to apply the Wrap with Effect.gen rewrite is not present.

What do you see instead?

TS Error: Type 'Effect<Asd, never, Asd>' is not a constructor function type. ts(2507)

export class Asd extends Effect.gen(function* () {
  return yield* Effect.Service<Asd>()("Asd", {
    succeed: {}
  });
}) {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions