@@ -50,7 +50,6 @@ addDataConstructor :: ModuleName -> ProperName -> [String] -> ProperName -> [Typ
50addDataConstructor moduleName name args dctor tys = do
50addDataConstructor moduleName name args dctor tys = do
51 env <- getEnv
51 env <- getEnv
52 dataConstructorIsNotDefined moduleName dctor
52 dataConstructorIsNotDefined moduleName dctor
53− when (runModuleName moduleName == dctor) $ throwError "A data constructor may not have the same name as its enclosing module."
54 let retTy = foldl TypeApp (TypeConstructor (Qualified (Just moduleName) name)) (map TypeVar args)
53 let retTy = foldl TypeApp (TypeConstructor (Qualified (Just moduleName) name)) (map TypeVar args)
55 let dctorTy = foldr function retTy tys
54 let dctorTy = foldr function retTy tys
56 let polyType = mkForAll args dctorTy
55 let polyType = mkForAll args dctorTy