Skip to content

Add unsafe Effect type assertion diagnostic#728

Merged
mattiamanzati merged 2 commits into
mainfrom
feat/unsafe-effect-type-assertion
May 7, 2026
Merged

Add unsafe Effect type assertion diagnostic#728
mattiamanzati merged 2 commits into
mainfrom
feat/unsafe-effect-type-assertion

Conversation

@mattiamanzati

Copy link
Copy Markdown
Contributor

Summary

  • add a new unsafeEffectTypeAssertion effect-native diagnostic that reports as Effect<...> assertions which unsafely narrow the error or requirements channels
  • skip checks when the original E or R channel is any, and provide a quick fix that removes the assertion while preserving the original expression
  • add v3/v4 examples, snapshots, generated metadata, README, schema updates, and a changeset for the new diagnostic

Example

const program: Effect.Effect<string, "boom", "service"> = ...

program as Effect.Effect<string, never, never>

This now reports that the assertion narrows the error channel from "boom" to never and the requirements channel from "service" to never.

Validation

  • pnpm codegen
  • pnpm lint-fix
  • pnpm check
  • pnpm test
  • pnpm test:v4

@changeset-bot

changeset-bot Bot commented May 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b95b6ce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@effect/language-service Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mattiamanzati mattiamanzati merged commit a5b0e47 into main May 7, 2026
5 checks passed
@mattiamanzati mattiamanzati deleted the feat/unsafe-effect-type-assertion branch May 7, 2026 12:29
@github-actions github-actions Bot mentioned this pull request May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant