Commit e6345d85 authored by Kai-Oliver Prott's avatar Kai-Oliver Prott
Browse files

Fix Type-Check for instance declarations with ambiguous funtion names

parent 6703ea08
...@@ -869,7 +869,11 @@ tcTopPDecl (i, ClassDecl p cx cls tv ds) = withLocalSigEnv $ do ...@@ -869,7 +869,11 @@ tcTopPDecl (i, ClassDecl p cx cls tv ds) = withLocalSigEnv $ do
tcTopPDecl (i, InstanceDecl p cx qcls ty ds) = do tcTopPDecl (i, InstanceDecl p cx qcls ty ds) = do
tcEnv <- getTyConsEnv tcEnv <- getTyConsEnv
pty <- expandPoly $ QualTypeExpr NoSpanInfo cx ty pty <- expandPoly $ QualTypeExpr NoSpanInfo cx ty
vpds' <- mapM (tcInstanceMethodPDecl qcls pty) vpds mid <- getModuleIdent
let origCls = getOrigName mid qcls tcEnv
clsQual = head $ filter isQualified $ reverseLookupByOrigName origCls tcEnv
qQualCls = qualQualify (fromJust $ qidModule clsQual) qcls
vpds' <- mapM (tcInstanceMethodPDecl qQualCls pty) vpds
return (i, InstanceDecl p cx qcls ty $ fromPDecls $ map untyped opds ++ vpds') return (i, InstanceDecl p cx qcls ty $ fromPDecls $ map untyped opds ++ vpds')
where (vpds, opds) = partition (isValueDecl . snd) $ toPDecls ds where (vpds, opds) = partition (isValueDecl . snd) $ toPDecls ds
tcTopPDecl _ = internalError "Checks.TypeCheck.tcTopDecl" tcTopPDecl _ = internalError "Checks.TypeCheck.tcTopDecl"
......
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