ucsd-progsys / liquidhaskell

Liquid Types For Haskell
BSD 3-Clause "New" or "Revised" License
1.2k stars 139 forks source link

DuplicateRecordFields breaks LH #2377

Open gergoerdi opened 1 month ago

gergoerdi commented 1 month ago

The following is a valid, well-typed Haskell program:

{-# LANGUAGE DuplicateRecordFields #-}
module DuplicateRecordFields where

data Foo = MkFoo{ fd :: Int }
data Bar = MkBar{ fd :: Int }

But LH as of cce470dec80b93729c0c92189613531e79a25c1e rejects it with:

**** LIQUID: ERROR *************************************************************
<no location info>: error:
    :1:1-1:1: Error
  Multiple sorts for DuplicateRecordFields.fd
      [func(0 , [DuplicateRecordFields.Bar; int]) : [],
       func(0 , [DuplicateRecordFields.Foo; int]) : []]
ranjitjhala commented 1 month ago

Yikes -- @facundominguez -- a fresh issue to consider with DuplicateRecordFields (I think we'd have to qualify the field names with the type...)

facundominguez commented 2 weeks ago

This bit in the GHC source code could be helpful when deciding how to fix it.