There certainly does seem a possibility that the detective story will come to an end, simply because the public will have learnt all the tricks.
Source:
-- Dorothy L Sayers, (Jun 13 1893-1957), English author; She wrote sophisticated detective stories featuring the amateur sleuth, Lord Peter Wimsey, e.g., Strong Poison, 1930.