@@ -1,4 +1,5 @@
1{-# LANGUAGE AllowAmbiguousTypes #-}
1{-# LANGUAGE AllowAmbiguousTypes #-}
2{-# LANGUAGE ConstraintKinds #-}
3{-# LANGUAGE ConstraintKinds #-}
3{-# LANGUAGE DataKinds #-}
4{-# LANGUAGE DataKinds #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE FlexibleInstances #-}
@@ -127,15 +128,20 @@ instance -- see Note [Changing type parameters]
127 ( Generic s
128 ( Generic s
128 , ErrorUnless field s (CollectField field (Rep s))
129 , ErrorUnless field s (CollectField field (Rep s))
129 , Generic t
130 , Generic t
131+ -- see Note [CPP in instance constraints]
132+#if __GLASGOW_HASKELL__ < 802
133+ , '(s', t') ~ '(Proxied s, Proxied t)
130 , s' ~ Proxied s
135 , s' ~ Proxied s
131 , t' ~ Proxied t
136 , t' ~ Proxied t
132 , Generic s'
138 , Generic s'
133 , Generic t'
139 , Generic t'
134 , GHasField' field (Rep s) a
140 , GHasField' field (Rep s) a
135 , GHasField' field (Rep s') a'
141 , GHasField' field (Rep s') a'
142+ , GHasField' field (Rep t') b'
136 , GHasField field (Rep s) (Rep t) a b
143 , GHasField field (Rep s) (Rep t) a b
137 , t ~ Infer s a' b
144 , t ~ Infer s a' b
138− , GHasField' field (Rep t') b'
139 , s ~ Infer t b' a
145 , s ~ Infer t b' a
140 ) => HasField field s t a b where
146 ) => HasField field s t a b where