Capture and simplify constraints arising from running typed splices
This fixes a regression caused by #15471 where splicing in a trivial program such as `[|| return () ||]` would fail as the dictionary for `return` would never get bound in the module containing the splice. Arguably this is symptomatic of a major problem affecting TTH where we serialise renamed asts and then retype check them. The reference to the dictionary should be fully determined at the quote site so that splicing doesn't have to solve any implicits at all. It's a coincidence this works due to coherence but see #15863 and #15865 for examples where things do go very wrong. Fixes #16195
Showing
- compiler/typecheck/TcSplice.hs 8 additions, 3 deletionscompiler/typecheck/TcSplice.hs
- testsuite/tests/th/T16195.hs 15 additions, 0 deletionstestsuite/tests/th/T16195.hs
- testsuite/tests/th/T16195A.hs 13 additions, 0 deletionstestsuite/tests/th/T16195A.hs
- testsuite/tests/th/all.T 1 addition, 0 deletionstestsuite/tests/th/all.T
Loading
Please register or sign in to comment