@@ -219,9 +219,12 @@ renameInModule imports exports (Module mn decls exps) =
219 updateValue :: (Maybe SourceSpan, [Ident]) -> Expr -> Either ErrorStack ((Maybe SourceSpan, [Ident]), Expr)
219 updateValue :: (Maybe SourceSpan, [Ident]) -> Expr -> Either ErrorStack ((Maybe SourceSpan, [Ident]), Expr)
220 updateValue (_, bound) v@(PositionedValue pos' _ _) = return ((Just pos', bound), v)
220 updateValue (_, bound) v@(PositionedValue pos' _ _) = return ((Just pos', bound), v)
221 updateValue (pos, bound) (Abs (Left arg) val') = return ((pos, arg : bound), Abs (Left arg) val')
221 updateValue (pos, bound) (Abs (Left arg) val') = return ((pos, arg : bound), Abs (Left arg) val')
222− updateValue (pos, bound) (Let ds val') =
222+ updateValue (pos, bound) (Let ds val') = do
223 let args = mapMaybe letBoundVariable ds
223 let args = mapMaybe letBoundVariable ds
224+ unless (length (nub args) == length args) $
225+ throwError $ maybe id (\p e -> positionError p <> e) pos $ mkErrorStack ("Overlapping names in let binding.") Nothing
224− in return ((pos, args ++ bound), Let ds val')
226+ return ((pos, args ++ bound), Let ds val')
225 updateValue (pos, bound) (Var name'@(Qualified Nothing ident)) | ident `notElem` bound =
228 updateValue (pos, bound) (Var name'@(Qualified Nothing ident)) | ident `notElem` bound =
226 (,) (pos, bound) <$> (Var <$> updateValueName name' pos)
229 (,) (pos, bound) <$> (Var <$> updateValueName name' pos)
227 updateValue (pos, bound) (Var name'@(Qualified (Just _) _)) =
230 updateValue (pos, bound) (Var name'@(Qualified (Just _) _)) =