Commit cc175183 authored by Michael Hanus 's avatar Michael Hanus
Browse files

Bug fix for "f b | b = True", Success type removed

parent 8a2261e6
......@@ -27,7 +27,7 @@ module Base.Types
, TypeScheme (..), ExistTypeScheme (..), monoType, polyType
-- * Predefined types
, unitType, boolType, charType, intType, floatType, stringType
, successType, listType, ioType, tupleType, typeVar, predefTypes
, listType, ioType, tupleType, typeVar, predefTypes
) where
import Curry.Base.Ident
......@@ -35,9 +35,8 @@ import Curry.Base.Ident
-- A type is either a type variable, an application of a type constructor
-- to a list of arguments, or an arrow type. The 'TypeConstrained'
-- case is used for representing type variables that are restricted to a
-- particular set of types. At present, this is used for typing guard
-- expressions, which are restricted to be either of type 'Bool' or of type
-- 'Success', and integer literals, which are restricted to types 'Int' and
-- particular set of types. At present, this is used for typing
-- integer literals, which are restricted to types 'Int' and
-- 'Float'. If the type is not restricted, it defaults to the first type
-- from the constraint list.
-- The case 'TypeSkolem' is used for handling skolem types, which
......@@ -246,9 +245,6 @@ floatType = primType qFloatId []
stringType :: Type
stringType = listType charType
successType :: Type
successType = primType qSuccessId []
listType :: Type -> Type
listType ty = primType qListId [ty]
......
......@@ -696,8 +696,7 @@ tcRhs tyEnv0 (GuardedRhs es ds) = do
tcCondExprs :: ValueEnv -> [CondExpr] -> TCM Type
tcCondExprs tyEnv0 es = do
gty <- if length es > 1 then return boolType
else freshConstrained [successType, boolType]
let gty = boolType -- the type of conditions
ty <- freshTypeVar
mapM_ (tcCondExpr gty ty) es
return ty
......
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