unison/unison-src/transcripts/fix2840.output.md
2024-07-15 19:10:27 +01:00

1.2 KiB

This bugfix addresses an issue where embedded Unison code in UCM was expected to be present in the active codebase when the display command was used render Doc values.

First, a few [hidden] definitions necessary for typechecking a simple Doc2.

scratch/main> add

  ⍟ I've added these definitions:
  
    type Doc2
    type Doc2.SpecialForm
    type Doc2.Term
    structural type Optional a
      (also named builtin.Optional)
    syntax.docParagraph       : [Doc2] -> Doc2
    syntax.docUntitledSection : [Doc2] -> Doc2
    syntax.docWord            : Text -> Doc2

Next, define and display a simple Doc:

README = {{
Hi
}}
scratch/main> display README

  Hi

Previously, the error was:

⚙️   Processing stanza 5 of 7.ucm: PE [("die",SrcLoc {srcLocPackage = "unison-parser-typechecker-0.0.0-He2Hp1llokT2nN4MnUfUXz", srcLocModule = "Unison.Runtime.Interface", srcLocFile = "src/Unison/Runtime/Interface.hs", srcLocStartLine = 118, srcLocStartCol = 18, srcLocEndLine = 118, srcLocEndCol = 60})] Lit
  AnnotatedText (fromList [Segment {segment = "Unknown term reference: #4522d", annotation = Nothing}])

but as of this PR, it's okay.