@@ -2041,7 +2041,8 @@ elabInstance info syn what fc cs n ps t expn ds = do
2041 (CantResolveAlts (map (show . fst) cs))
2041 (CantResolveAlts (map (show . fst) cs))
2042 let constraint = PApp fc (PRef fc n) (map pexp ps)
2042 let constraint = PApp fc (PRef fc n) (map pexp ps)
2043 let iname = mkiname n ps expn
2043 let iname = mkiname n ps expn
2044+ let emptyclass = null (class_methods ci)
2044− when (what /= EDefns || null ds) $ do
2045+ when (what /= EDefns || (null ds && not emptyclass)) $ do
2045 nty <- elabType' True info syn emptyDocstring [] fc [] iname t
2046 nty <- elabType' True info syn emptyDocstring [] fc [] iname t
2046 -- if the instance type matches any of the instances we have already,
2047 -- if the instance type matches any of the instances we have already,
2047 -- and it's not a named instance, then it's overlapping, so report an error
2048 -- and it's not a named instance, then it's overlapping, so report an error
@@ -2050,7 +2051,7 @@ elabInstance info syn what fc cs n ps t expn ds = do
2050 (class_instances ci)
2051 (class_instances ci)
2051 addInstance intInst n iname
2052 addInstance intInst n iname
2052 Just _ -> addInstance intInst n iname
2053 Just _ -> addInstance intInst n iname
2053− when (what /= ETypes && (not (null ds))) $ do
2054+ when (what /= ETypes && (not (null ds && not emptyclass))) $ do
2054 let ips = zip (class_params ci) ps
2055 let ips = zip (class_params ci) ps
2055 let ns = case n of
2056 let ns = case n of
2056 NS n ns' -> ns'
2057 NS n ns' -> ns'