Skip to content

Fix constrained ignored lambdas in Plutus Tx#7815

Open
knoal wants to merge 1 commit into
IntersectMBO:masterfrom
knoal:feat/6085-unannotated-lambdas
Open

Fix constrained ignored lambdas in Plutus Tx#7815
knoal wants to merge 1 commit into
IntersectMBO:masterfrom
knoal:feat/6085-unannotated-lambdas

Conversation

@knoal

@knoal knoal commented Jun 11, 2026

Copy link
Copy Markdown

Summary

Fix the issue-aligned ignored-lambda regression from #6085 by recovering constrained argument types for naked lambdas like \_ _ -> () and \_ _ _ -> () when the surrounding expected type is known.

What changed

  • thread an optional expected type from compileMarkedExpr into the initial compileExprWithDefs entrypoint
  • when that expected type is available, retag leading erased Any binders in the Core expression before handing control back to the normal expression compiler path
  • add TH regressions for the concrete constrained cases that match the reported failure shape:
    • CompiledCode (BuiltinData -> BuiltinData -> ())
    • CompiledCode (BuiltinData -> BuiltinData -> BuiltinData -> ())
  • add/update goldens for GHC 9.6 and 9.12

Scope / note on narrowing

During local validation I found that a broader polymorphic TH repro was too wide for a clean-state fix here. This PR intentionally targets the issue-aligned constrained case from #6085, where surrounding context already determines the lambda argument types.

Validation

Local focused validation:

  • cabal test --project-file=cabal.project.plugin-tests plutus-tx-plugin-tests --test-options='--accept --pattern=ignoredUntyped'
  • cabal test --project-file=cabal.project.plugin-tests plutus-tx-plugin-tests --test-options='--pattern=/TH/'

Both passed locally after the narrowed fix.

Related issue

This comment was marked as resolved.

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.

Investigate if lambdas not annotated with types fail to compile in Plutus Tx

2 participants