Skip to content

Commit e12dd9a

Browse files
sjakobimergify[bot]
authored andcommitted
dhall-json: Don't normalize schema type before type-checking (#1555)
The normalization removed the source context on the expression, which made the type error message harder to understand. Fixes #1515.
1 parent 4bf970b commit e12dd9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dhall-json/src/Dhall/JSONToDhall.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,15 @@ defaultConversion = Conversion
330330
-- | The 'Expr' type concretization used throughout this module
331331
type ExprX = Expr Src Void
332332

333-
-- | Parse schema code to a valid Dhall expression and check that its type is actually Type
333+
-- | Parse schema code and resolve imports
334334
resolveSchemaExpr :: Text -- ^ type code (schema)
335335
-> IO ExprX
336336
resolveSchemaExpr code = do
337337
parsedExpression <-
338338
case Dhall.Parser.exprFromText "\n\ESC[1;31mSCHEMA\ESC[0m" code of
339339
Left err -> throwIO err
340340
Right parsedExpression -> return parsedExpression
341-
D.normalize <$> Dhall.Import.load parsedExpression -- IO
341+
Dhall.Import.load parsedExpression
342342

343343
{-| Check that the Dhall type expression actually has type 'Type'
344344
>>> :set -XOverloadedStrings

0 commit comments

Comments
 (0)