From 363ef6a9bc2d1a1aa50856dcf5447e9c967d8ae9 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 27 Mar 2009 09:44:05 +0000 Subject: [PATCH] Made sure that user types are resolved when type-checking for occam --- frontends/OccamTypes.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontends/OccamTypes.hs b/frontends/OccamTypes.hs index 40c9f0c..3bf179d 100644 --- a/frontends/OccamTypes.hs +++ b/frontends/OccamTypes.hs @@ -59,6 +59,13 @@ sameType (A.Chan _ ta) (A.Chan _ tb) = sameType ta tb sameType (A.ChanEnd dira _ ta) (A.ChanEnd dirb _ tb) = liftM (dira == dirb &&) (sameType ta tb) sameType (A.Mobile ta) (A.Mobile tb) = sameType ta tb +-- Resolve user data types: +sameType ta@(A.UserDataType {}) tb + = do ta' <- resolveUserType emptyMeta ta + sameType ta' tb +sameType ta tb@(A.UserDataType {}) + = do tb' <- resolveUserType emptyMeta tb + sameType ta tb' sameType a b = return $ a == b -- | Check that the second dimension can be used in a context where the first