From 7bbfab34a04f996675a54b4a17c414d192d99e47 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sun, 18 May 2008 09:42:51 +0000 Subject: [PATCH] Added simple instances of the Typed class for actuals and formals --- common/Types.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/Types.hs b/common/Types.hs index ad3873f..bf31e0a 100644 --- a/common/Types.hs +++ b/common/Types.hs @@ -73,6 +73,13 @@ abbrevModeOfName n instance Typed A.Name where astTypeOf = typeOfName +instance Typed A.Formal where + astTypeOf (A.Formal _ t _) = return t + +instance Typed A.Actual where + astTypeOf (A.ActualVariable v) = astTypeOf v + astTypeOf (A.ActualExpression e) = astTypeOf e + -- | Gets the 'A.Type' for a given 'A.Name' by looking at its definition in the 'CompState'. Dies with an error if the name is unknown. typeOfName :: (CSMR m, Die m) => A.Name -> m A.Type typeOfName n