Skip to content

Commit 61c5be9

Browse files
authored
Disallow with changing Optional record type (#2501)
See: dhall-lang/dhall-lang#1332 The standard already required this, but the Haskell implementation was not correctly conforming to the standard. Fixing this not only simplifies the Haskell code but also makes the code more greatly resemble the corresponding standard judgement.
1 parent 4fd1865 commit 61c5be9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

dhall/src/Dhall/TypeCheck.hs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,16 +1315,12 @@ infer typer = loop
13151315

13161316
VOptional _O' -> do
13171317
case ks of
1318-
WithQuestion :| [] -> do
1318+
WithQuestion :| _ -> do
13191319
tV' <- loop ctx v
13201320
if Eval.conv values _O' tV'
13211321
then return (VOptional _O')
13221322
else die OptionalWithTypeMismatch
13231323

1324-
WithQuestion :| k₁ : ks' -> do
1325-
tV' <- with _O' (k₁ :| ks') v
1326-
return (VOptional tV')
1327-
13281324
WithLabel k :| _ -> die (NotAQuestionPath k)
13291325

13301326
_ -> die (NotWithARecord e₀ (quote names tE')) -- TODO: NotWithARecordOrOptional

0 commit comments

Comments
 (0)