@@ -1295,13 +1295,11 @@ do_ syn
1295 reservedOp "="
1295 reservedOp "="
1296 (e, fc) <- withExtent $ expr (syn { withAppAllowed = False })
1296 (e, fc) <- withExtent $ expr (syn { withAppAllowed = False })
1297 -- If there is an explicit type, this can’t be a pattern-matching let, so do not parse alternatives
1297 -- If there is an explicit type, this can’t be a pattern-matching let, so do not parse alternatives
1299− Just ty -> return (DoLet fc RigW i ifc ty e)
1301− P.option (DoLet fc RigW i ifc Placeholder e)
1298+ P.option (DoLet fc RigW i ifc (fromMaybe Placeholder ty') e)
1302− (do lchar '|'
1299+ (do lchar '|'
1300+ when (isJust ty') $ fail "a pattern-matching let may not have an explicit type annotation"
1303− ts <- P.sepBy1 (do_alt (syn { withAppAllowed = False })) (lchar '|')
1301+ ts <- P.sepBy1 (do_alt (syn { withAppAllowed = False })) (lchar '|')
1304− return (DoLetP fc (PRef ifc [ifc] i) e ts)))
1302+ return (DoLetP fc (PRef ifc [ifc] i) e ts)))
1305 <|> P.try (do keyword "let"
1303 <|> P.try (do keyword "let"
1306 i <- expr' syn
1304 i <- expr' syn
1307 reservedOp "="
1305 reservedOp "="