Skip to content

Commit 44b9f30

Browse files
authored
Fix dhall-docs panic (#2552)
Fixes #2529
1 parent 8982b76 commit 44b9f30

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dhall-docs/src/Dhall/Docs/CodeRenderer.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,16 @@ fragments = Data.List.sortBy sorter . removeUnusedDecls . Writer.execWriter . in
245245
return NoInfo
246246

247247
where
248-
handleRecordLike l = RecordFields . Set.fromList <$> mapM f l
248+
handleRecordLike l = RecordFields . Set.fromList . concat <$> mapM f l
249249
where
250250
f (key, RecordField (Just Src{srcEnd = startPos}) val (Just Src{srcStart = endPos}) _) = do
251251
dhallType <- infer context val
252252
let nameSrc = makeSrcForLabel startPos endPos key
253253
let nameDecl = NameDecl nameSrc key dhallType
254254
Writer.tell [SourceCodeFragment nameSrc (NameDeclaration nameDecl)]
255-
return nameDecl
255+
return [ nameDecl ]
256256
where
257-
f _ = fileAnIssue "A `RecordField` of type `Expr Src Import` doesn't have `Just src*`"
257+
f _ = return [ ]
258258

259259
fileAsText :: File -> Text
260260
fileAsText File{..} = foldr (\d acc -> acc <> "/" <> d) "" (Core.components directory)

0 commit comments

Comments
 (0)