Commit f16590b2 authored by Kai Prott's avatar Kai Prott

Merge branch 'tc_ambig_fix' into 'master'

Fix Type-Check for instance declarations with ambiguous funtion names

Closes #39

See merge request !10
parents ea5b521e 799e9886
Change log for curry-frontend
=============================
Version 1.0.4
=============
* Fixed bug in type checking of instances
Version 1.0.3
=============
......@@ -308,4 +313,3 @@ Version 0.3.0
* All compiler warnings removed.
* Fixed various implementation bugs (#9, #16, #19, #29, #289).
......@@ -869,7 +869,11 @@ tcTopPDecl (i, ClassDecl p cx cls tv ds) = withLocalSigEnv $ do
tcTopPDecl (i, InstanceDecl p cx qcls ty ds) = do
tcEnv <- getTyConsEnv
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')
where (vpds, opds) = partition (isValueDecl . snd) $ toPDecls ds
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