Skip to content

Commit 5f8522d

Browse files
Fix the string hole detection
1 parent 1cad691 commit 5f8522d

File tree

1 file changed

+9
-4
lines changed
  • liquidhaskell-boot/src/Language/Haskell/Liquid/Constraint

1 file changed

+9
-4
lines changed

liquidhaskell-boot/src/Language/Haskell/Liquid/Constraint/Generate.hs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,15 @@ detectTypedHole :: CGEnv -> CoreExpr -> CG (Maybe (RealSrcSpan, Var))
302302
detectTypedHole _ (App (Tick genTick (Var x)) _) | isVarHole x
303303
= return (Just (getSrcSpanFromTick, x))
304304
where
305-
getSrcSpanFromTick = case genTick of
306-
SourceNote src _ -> src
307-
_ -> panic Nothing "Not a Source Note"
308-
isVarHole = L.isInfixOf "hole" . F.symbolString . F.symbol
305+
getSrcSpanFromTick =
306+
case genTick of
307+
SourceNote src _ -> src
308+
_ -> panic Nothing "Not a Source Note"
309+
isStrHole s =
310+
case break (=='.') s of
311+
(_, '.':rest) -> rest == "hole"
312+
_ -> False
313+
isVarHole = isStrHole . F.symbolString . F.symbol
309314
detectTypedHole _ _ = return Nothing -- NOT A TYPED HOLE
310315
--------------------------------------------------------------------------------
311316
-- | Bidirectional Constraint Generation: CHECKING -----------------------------

0 commit comments

Comments
 (0)