Commit 9558e65a authored by Jan Rasmus Tikovsky 's avatar Jan Rasmus Tikovsky
Browse files

Minor bugfix

parent 2a65272a
......@@ -740,19 +740,21 @@ checkVariable v
case qualLookupVar v env of
[] -> do report $ errUndefinedVariable v
return $ Variable v
[Constr _ _] -> return $ Constructor v
[GlobalVar _ _] -> return $ Variable v
[LocalVar v' _] -> return $ Variable $ qualify v'
[Constr _ _] -> return $ Constructor v
[GlobalVar _ _] -> return $ Variable v
[LocalVar v' _] -> return $ Variable $ qualify v'
[RecordLabel _ _] -> return $ Variable v
rs -> do
m <- getModuleIdent
case qualLookupVar (qualQualify m v) env of
[] -> do report $ errAmbiguousIdent rs v
return $ Variable v
[Constr _ _] -> return $ Constructor v
[GlobalVar _ _] -> return $ Variable v
[LocalVar v' _] -> return $ Variable $ qualify v'
rs' -> do report $ errAmbiguousIdent rs' v
return $ Variable v
[Constr _ _] -> return $ Constructor v
[GlobalVar _ _] -> return $ Variable v
[LocalVar v' _] -> return $ Variable $ qualify v'
[RecordLabel _ _] -> return $ Variable v
rs' -> do report $ errAmbiguousIdent rs' v
return $ Variable v
checkRecordExpr :: Position -> QualIdent -> [Field Expression] -> SCM Expression
checkRecordExpr _ c [] = do
......
......@@ -1083,8 +1083,10 @@ sureVarType v tyEnv = case lookupValue v tyEnv of
funType :: ModuleIdent -> QualIdent -> ValueEnv -> TypeScheme
funType m f tyEnv = case qualLookupValue f tyEnv of
[Value _ _ sigma] -> sigma
[Label _ _ sigma] -> sigma
_ -> case qualLookupValue (qualQualify m f) tyEnv of
[Value _ _ sigma] -> sigma
[Label _ _ sigma] -> sigma
_ -> internalError $ "TypeCheck.funType " ++ show f
++ ", more precisely " ++ show (unqualify f)
......
......@@ -13,4 +13,8 @@ fun C { l = 42 } = True
fun2 C {} = False
-- update
upd r = r { x = False, l = 0 }
\ No newline at end of file
upd r = r { x = False, l = 0 }
-- selection
getL :: R a -> Int
getL r = l r
\ No newline at end of file
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