TypeApplications does not imply AllowAmbiguousTypes
[ghc.git] / testsuite / tests / patsyn / should_compile / T11351.hs
1 {-# LANGUAGE PatternSynonyms, TypeApplications, ScopedTypeVariables, ViewPatterns,
2 AllowAmbiguousTypes #-}
3
4 module T11351 where
5
6 import GHC.TypeLits
7 import Data.Proxy
8
9 symbol :: forall s. KnownSymbol s => String
10 symbol = symbolVal @s Proxy
11
12 -- Not in scope: type variable ‘s’
13 -- Not in scope: type variable ‘s’
14 pattern Symbol :: forall s. KnownSymbol s => String
15 pattern Symbol <- ((== symbol @s) -> True) where
16 Symbol = symbol @s
17
18 -- • Could not deduce (KnownSymbol n0)
19 -- arising from a use of ‘symbolVal’
20 -- from the context: KnownSymbol s
21 -- bound by the type signature for pattern synonym ‘Symbol’:
22 -- String
23 pattern Symbol2 :: forall s. KnownSymbol s => String
24 pattern Symbol2 <- ((== symbolVal (Proxy :: Proxy s)) -> True)