Skip to content
  • Sebastian Graf's avatar
    PmCheck: Record type constraints arising from existentials in `PmCoreCt`s · c90eca55
    Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
    In #17703 (a follow-up of !2192), we established that contrary to my
    belief, type constraints arising from existentials in code like
    
    ```hs
    data Ex where Ex :: a -> Ex
    f _ | let x = Ex @Int 15 = case x of Ex -> ...
    ```
    
    are in fact useful.
    
    This commit makes a number of refactorings and improvements to comments,
    but fundamentally changes `addCoreCt.core_expr` to record the type
    constraint `a ~ Int` in addition to `x ~ Ex @a y` and `y ~ 15`.
    
    Fixes #17703.
    c90eca55