on master help sign in
Add test case for #40
218704eCsongor Kiss
generic-lens.cabal+1−1
@@ -84,7 +84,7 @@ test-suite generic-lens-test
84 type: exitcode-stdio-1.0
84 type: exitcode-stdio-1.0
85 hs-source-dirs: test
85 hs-source-dirs: test
86 main-is: Spec.hs
86 main-is: Spec.hs
87− other-modules: Util Test24 Test25
87+ other-modules: Util Test24 Test25 Test40
88
88
89 build-depends: base >= 4.9 && <= 5.0
89 build-depends: base >= 4.9 && <= 5.0
90 , generic-lens
90 , generic-lens
test/Test40.hsnew file+22
@@ -0,0 +1,22 @@
1+{-# LANGUAGE TypeFamilies #-}
2+{-# LANGUAGE TypeApplications #-}
3+{-# LANGUAGE DataKinds #-}
4+{-# LANGUAGE DeriveGeneric #-}
5+{-# OPTIONS_GHC -Wall #-}
6+
7+module Test40 where
8+
9+import Data.Generics.Product
10+import GHC.Generics
11+
12+class MyClass a where
13+ data AssocData a
14+
15+instance MyClass Int where
16+ data AssocData Int = SomeData
17+ { val :: Int
18+ } deriving (Generic)
19+
20+main :: IO ()
21+main
22+ = print $ getField @"val" (SomeData 3)