on master help sign in
Better error for ambiguous instance name

Fixes #1066

commit7ed177a9f09e28dbf2e311b0f468f472e54f8fcd authorEdwin Brady <ecb10@st-andrews.ac.uk> dateThu 24 Apr 2014, 10:05 (13 years ago) parentf2bf55d
1 file changed+3−1
src/Idris/ElabDecls.hs+3−1
src/Idris/ElabDecls.hs+3−1
@@ -1979,7 +1979,9 @@ elabInstance info syn what fc cs n ps t expn ds = do
19791979 i <- getIState
19801980 (n, ci) <- case lookupCtxtName n (idris_classes i) of
19811981 [c] -> return c
1982− _ -> ifail $ show fc ++ ":" ++ show n ++ " is not a type class"
1982+ [] -> ifail $ show fc ++ ":" ++ show n ++ " is not a type class"
1983+ cs -> tclift $ tfail $ At fc
1984+ (CantResolveAlts (map (show . fst) cs))
19831985 let constraint = PApp fc (PRef fc n) (map pexp ps)
19841986 let iname = mkiname n ps expn
19851987 when (what /= EDefns) $ do