You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE FlexibleInstances #-}
--| Same as `SH_Overlap5` but dependencies are now inferred-safe, not-- explicitly marked. Compilation should still fail.moduleSH_Overlap6whereimport safe SH_Overlap6_AinstanceC [a] where
f _ ="[a]"test::String
test = f ([1,2,3,4] :: [Int])
creates the following message:
SH_Overlap6.hs:15:8: error: [GHC-36705]
• Unsafe overlapping instances for C [Int]
arising from a use of ‘f’
The matching instance is:
instance [overlap ok] [safe] C [Int]
-- Defined at SH_Overlap6_A.hs:12:3
It is compiled in a Safe module and as such can only
overlap instances from the same module, however it
overlaps the following instances from different modules:
instance [safe] C [a] -- Defined at SH_Overlap6.hs:11:10
• In the expression: f ([1, 2, 3, 4] :: [Int])
In an equation for ‘test’: test = f ([1, 2, 3, 4] :: [Int])
No description provided.
The text was updated successfully, but these errors were encountered: