Skip to content

ExternsDiff: Consider all types recursively in instance head as dependencies#10

Merged
zyla merged 1 commit intorestaumaticfrom
fix-instance-recompilation-check
Jun 23, 2025
Merged

ExternsDiff: Consider all types recursively in instance head as dependencies#10
zyla merged 1 commit intorestaumaticfrom
fix-instance-recompilation-check

Conversation

@zyla
Copy link
Collaborator

@zyla zyla commented Jun 20, 2025

Fixes recompilation bug reproduced by https://github.com/zyla/purs-recompilation-repro-2.

The bug happens in converting an EDInstance to a Ref. TypeInstanceRef contains a list of local types mentioned in the instance head. However, the conversion only detected types mentioned directly in the instance head without arguments.

So in the reproduction example, we get the following entry in depsDiffs:

ProperName {runProperName = "Bar"}),Updated),(TypeInstanceRef (Ident "fooBar") (ModuleName "TC",ProperName {runProperName = "Foo"}) []

When we should get:

ProperName {runProperName = "Bar"}),Updated),(TypeInstanceRef (Ident "fooBar") (ModuleName "TC",ProperName {runProperName = "Foo"}) [ProperName {runProperName = "Bar"}]

The fix is to recursively traverse the instance head, searching for local types.

@zyla zyla requested review from jborkowski and kozak June 20, 2025 11:31
Copy link

@kozak kozak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯

@zyla zyla merged commit 3fcac77 into restaumatic Jun 23, 2025
7 checks passed
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.

3 participants