@@ -474,8 +474,8 @@ inferBinder val (UnaryBinder ctor binder) = do
474 modulePath <- checkModulePath `fmap` lift get
474 modulePath <- checkModulePath `fmap` lift get
475 case M.lookup (qualify modulePath ctor) (dataConstructors env) of
475 case M.lookup (qualify modulePath ctor) (dataConstructors env) of
476 Just ty -> do
476 Just ty -> do
477− obj <- fresh
477+ Function [obj] ret <- replaceAllVarsWithUnknowns ty
478− ty `subsumes` (Function [obj] val)
478+ val `subsumes` ret
479 inferBinder obj binder
479 inferBinder obj binder
480 _ -> throwError $ "Constructor " ++ show ctor ++ " is not defined"
480 _ -> throwError $ "Constructor " ++ show ctor ++ " is not defined"
481inferBinder val (ObjectBinder props) = do
481inferBinder val (ObjectBinder props) = do