Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types.coercedTo does not support type merging #352253

Open
roberth opened this issue Oct 30, 2024 · 0 comments · May be fixed by #352252
Open

types.coercedTo does not support type merging #352253

roberth opened this issue Oct 30, 2024 · 0 comments · May be fixed by #352252
Labels
0.kind: bug Something is broken 6.topic: module system About "NixOS" module system internals

Comments

@roberth
Copy link
Member

roberth commented Oct 30, 2024

Describe the bug

Type merging is not implemented for coercedTo.

Steps To Reproduce

Have two declarations of type coercedTo a f b.

Expected behavior

  1. (coercedTo a f b).typeMerge (coercedTo a2 null b2) = coercedTo (a.typeMerge a2) f (b.typeMerge b2)
  2. (coercedTo a f b).typeMerge b2 = coercedTo a f (b.typeMerge b2)
  • but since type merging must be symmetric, also b2.typeMerge (coercedTo a f b)... However, coercedTo does not control b2.typeMerge. Can we make all b2.typeMerge try to fall back to b.typeMerge? Prevent infinite (mutual) recursion.

(1) without (2) is already a significant improvement.

Screenshots

Additional context

Notify maintainers

@infinisil @roberth

Metadata


Add a 👍 reaction to issues you find important.

@roberth roberth added 0.kind: bug Something is broken 6.topic: module system About "NixOS" module system internals labels Oct 30, 2024
@roberth roberth linked a pull request Oct 30, 2024 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: module system About "NixOS" module system internals
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant