on master help sign in
jrec/test/JRecShouldNotTypecheckSpec.hs
15 lines 384 B history raw
1{-# OPTIONS_GHC -fdefer-type-errors #-}
3module JRecShouldNotTypecheckSpec (spec) where
5import Control.Lens ((&), (.~), (^.))
6import JRec
7import Test.Hspec
8import Test.ShouldNotTypecheck
9import GHC.Stack
11spec :: Spec
12spec = do
13 describe "insert" $ do
14 it "type-check fails if field already exists" $ do
15 shouldNotTypecheck ((#a := '1') `insert` Rec (#b := '2', #a := '0'))