Can we use silver nitrate to distinguish between chloride and carbonate salts? Initially, we are given a solution containing two salts, they can be either carbonate or chloride salts (we do not know their composition initially).
Generally, $\ce{AgNO3}$ is used as a confirmatory test of $\ce{Cl-}$ (a white precipitate is obtained on adding silver nitrate to solution containing the chloride salt). Therefore, can we use this method to directly identify chloride in the solution or do we need to remove the possible carbonate ions to confirm the presence of chloride before performing the test as mentioned above?
$$\ce{NaCl + AgNO3 -&gt; NaNO3 + \underset{white}{AgCl} \downarrow}$$
$$\ce{Na2CO3 + 2AgNO3 -&gt; 2NaNO3 + \underset{brownish white}{Ag2CO3} \downarrow}$$
(A similar question may arise in the identification of bromide and iodide ions but I have ignored it for now as they are rarely asked in exams. Still I would appreciate it if someone could give an answer for this as well.)
The question has been asked mainly because silver nitrate test is generally taught to be performed without mentioning above precautions and it is also a very famous confirmative test. So answer is expected more (not only) from a laboratory technician than theorist.
The test for Chloride ion is silver nitrite in an Acidified solution [with nitric acid]. This removes carbonate (as carbonic acid), cyanide[careful] and sulfide (as hydrogen sulfide). Sulfate must be absent, if present it can be removed with barium nitrate (as barium sulfate).  The silver chloride formed is solubilized by addition of ammonia; insoluble precipitate remaining may be bromide or iodide. The exact procedure to follow is given in reputed indepth Qualitative Analysis lab books.