@@ -1018,10 +1018,11 @@ check' (TypeClassDictionaryConstructorApp name ps) t = do
10181018 return $ TypedValue True (TypeClassDictionaryConstructorApp name ps') t
10191019check' (ObjectUpdate obj ps) t@(TypeApp o row) | o == tyObject = do
10201020 ensureNoDuplicateProperties ps
1021− us <- zip (map fst ps) <$> replicateM (length ps) fresh
1021+ -- We need to be careful to avoid duplicate labels here.
1022+ -- We check _obj_ agaist the type _t_ with the types in _ps_ replaced with unknowns.
10221023 let (propsToCheck, rest) = rowToList row
1023− propsToRemove = map fst ps
1024− remainingProps = filter (\(p, _) -> p `notElem` propsToRemove) propsToCheck
1024+ (removedProps, remainingProps) = partition (\(p, _) -> p `elem` map fst ps) propsToCheck
1025+ us <- zip (map fst removedProps) <$> replicateM (length ps) fresh
10251026 obj' <- check obj (TypeApp tyObject (rowFromList (us ++ remainingProps, rest)))
10261027 ps' <- checkProperties ps row True
10271028 return $ TypedValue True (ObjectUpdate obj' ps') t