The paper I just got to review consists of Theorem A and its Corollary B, the latter settling a major open problem in the field, it is said.
Unfortunately, the problem is not open, it was done in an obscure paper half a century ago (a not uncommon mistake, I must stress this doesn't imply or suggest foul play). I haven't yet started to read the submitted paper properly, but I know that - if correct - Theorem A on its own merits publication. I worry that if I point out the obscure paper to the author in the review, they may want to withdraw or very substantially change their submission, possibly making swathes of my review irrelevant and thus wasting my time and work. What is the proper etiquette here? Should I:
complete an honest review of the whole paper and only then inform both author and editor that the problem was settled before?
write a very short "why don't you mention that old paper?" review framed as "needs MAJOR revisions"?
contact the editor and ask them to pass the information before I agree to write the review?
write my review with a comprehensive comparison between the submitted paper and the old obscure one?
other?
Point 4. is just a bonus question to see if people here do think that it's referee's duty to do so (I am of "in the perfect world we would have time for that" persuasion). I am wary of point 2., since it may prompt some editors to reject the paper outright, and it doesn't seem fair in this case. Hence I wonder about point 3. For what is worth, in my field I do have access to the paper before I agree to referee, so my impressions are not based just on the abstract, in particular I am sure the author does not cite the obscure paper.
UPDATE: Thanks everyone for your suggestions. Here's what I did, and why.
The paper under review and the older paper were both quite short for the field, so I spend one afternoon skimming through them. I concluded that the methods were significantly different, but there are parts of the older paper that will influence the body of the paper under review, and not only merit a "We note that the Corollary B appears in (...)" line.
I then filed a review recommending a resubmission after revision, pointing to the prior paper and how I see it might influence the present work. I explained that I didn't go too deep in the paper (for the reasons mentioned above) but I will be happy to review it if resubmitted. I also tried to be supportive, stating that the results seem correct (I could write that after that afternoon reading) and interesting, and in particular appropriate for publication.
I also wrote directly to the editor and appraised them of the situation. I politely asked them to a) contact the other reviewers and notify them about the prior work, as I honestly expect they may not know about it, or b) pass my review to the author before all other reviews come in. The editor sent me a generic "thank you for your time", and that was it.
I accepted Allure's answer, as I think that if the papers were not so short, I wouldn't be able (and willing to spend time) to compare them so quickly and thus would pass that responsibility entirely to the author. I also wouldn't be able to quickly write anything resembling a review, and so probably would just ask the editor to contact the author and persuade them to resubmit after they take a look at the old paper. Moreover I convinced myself that I should contact the editor outside of just filing the review, since it may take arbitrarily long for the other reviews to come in and are eventually made available to the author, and all this time is wasted for them (not to mention for the fellow reviewers, as in this particular case it is possible they too can be unaware of that older paper). What motivated me in the end was the possibility that the author could find out that older paper while still waiting for the reviews, and then worry (as before, arbitrarily long) about ramifications - hence I think it was better for me to break the news to them with a generally positive message as soon as possible.
While I don't know if I will be called to referee this paper again, it's nice that we mathematicians have arxiv and so I will be able to see what happens with it either way - published in this journal? elsewhere? better? For all interested, I promise to update this question again in five years or when the paper is finally published (whichever comes later:)