Skip to content

Fix Types.DeepMutable mapping over functions#5752

Merged
gcanti merged 4 commits intoEffect-TS:mainfrom
janglad:types-mutable
Nov 16, 2025
Merged

Fix Types.DeepMutable mapping over functions#5752
gcanti merged 4 commits intoEffect-TS:mainfrom
janglad:types-mutable

Conversation

@janglad
Copy link
Copy Markdown
Contributor

@janglad janglad commented Nov 15, 2025

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Previously Types.DeepMutable mapped over functions, resulting in

import { Types } from "effect";

declare const someFn: (arg: { date: Date }) => void;

declare const myArg: Types.DeepMutable<{ date: Date }>;

someFn(myArg);

/*
Argument of type '{ date: { toString: {}; toDateString: {}; toTimeString: {}; toLocaleString: {}; toLocaleDateString: {}; toLocaleTimeString: {}; valueOf: {}; getTime: {}; getFullYear: {}; getUTCFullYear: {}; getMonth: {}; ... 33 more ...; [Symbol.toPrimitive]: {}; }; }' is not assignable to parameter of type '{ date: Date; }'.
  The types of 'date.toString' are incompatible between these types.
    Type '{}' is not assignable to type '() => string'.
      Type '{}' provides no match for the signature '(): string'.(
 */

This fixes this while adding some tests for this.

Related

  • Related Issue #
  • Closes #

@janglad janglad requested a review from mikearnaldi as a code owner November 15, 2025 21:38
@github-project-automation github-project-automation bot moved this to Discussion Ongoing in PR Backlog Nov 15, 2025
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Nov 15, 2025

🦋 Changeset detected

Latest commit: 2762907

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

This PR includes changesets to release 36 packages
Name Type
effect Patch
@effect/cli Patch
@effect/cluster Patch
@effect/experimental Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/platform Patch
@effect/printer-ansi Patch
@effect/printer Patch
@effect/rpc Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-drizzle Patch
@effect/sql-kysely Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/sql Patch
@effect/typeclass Patch
@effect/vitest Patch
@effect/workflow Patch
@effect/ai Patch
@effect/ai-amazon-bedrock Patch
@effect/ai-anthropic Patch
@effect/ai-google Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch

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

@gcanti gcanti changed the title Types mutable Fix Types.DeepMutable mapping over functions Nov 16, 2025
@gcanti gcanti merged commit f445b87 into Effect-TS:main Nov 16, 2025
11 checks passed
@github-project-automation github-project-automation bot moved this from Discussion Ongoing to Done in PR Backlog Nov 16, 2025
@github-actions github-actions bot mentioned this pull request Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants