Commit 5b910663 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com
Browse files

Slight refactoring for overloaded strings

parent 96cb07b5
...@@ -2257,14 +2257,14 @@ disambiguate extended_defaulting insts ...@@ -2257,14 +2257,14 @@ disambiguate extended_defaulting insts
-- use [Integer, Double] -- use [Integer, Double]
do { integer_ty <- tcMetaTy integerTyConName do { integer_ty <- tcMetaTy integerTyConName
; checkWiredInTyCon doubleTyCon ; checkWiredInTyCon doubleTyCon
; return [integer_ty, doubleTy] }
; string_ty <- tcMetaTy stringTyConName ; string_ty <- tcMetaTy stringTyConName
; ovlStr <- doptM Opt_OverloadedStrings ; ovl_str <- doptM Opt_OverloadedStrings
-- XXX This should not be added unconditionally, but the default declaration stuff ; if ovl_str -- Add String if -foverloaded-strings
-- is too wired to Num for me to understand. /LA then return [integer_ty,doubleTy,string_ty]
; let default_str_tys = default_tys ++ if ovlStr then [string_ty] else [] else return [integer_ty,doubleTy] }
; traceTc (text "disambigutate" <+> vcat [ppr unaries, ppr bad_tvs, ppr defaultable_groups]) ; traceTc (text "disambigutate" <+> vcat [ppr unaries, ppr bad_tvs, ppr defaultable_groups])
; mapM_ (disambigGroup default_str_tys) defaultable_groups } ; mapM_ (disambigGroup default_tys) defaultable_groups }
where where
unaries :: [(Inst,Class, TcTyVar)] -- (C tv) constraints unaries :: [(Inst,Class, TcTyVar)] -- (C tv) constraints
bad_tvs :: TcTyVarSet -- Tyvars mentioned by *other* constraints bad_tvs :: TcTyVarSet -- Tyvars mentioned by *other* constraints
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment