I tried (Version: 2023-09 (4.29.0)) simply editing the files but it brought my sub-projects up to the main project level which doesn't work for me. So just deleted them (without deleting files) and re-imported. Mine had happened because I had used Git to download a second copy of the same project set to a very old branch and then imported both versions into Eclipse. This must have messed things up in Eclipse.
The scenario being described is due to the continued existence of the deployment. So the solution is to delete the deployment. The edge-case you are referring to is not the answer and as-such needs more description as to when this is necessary and what causes it to be necessary.
While this will work, there is a better, more reliable way of accomplishing this task described in some of the other replies. stackoverflow.com/a/59503238/2443197
@cefn - point taken, I tried to give lots of examples to show what I meant. Basically my object has 30+ properties, each with a default value, I'm getting back from the server an array of a few 1000 items, each of which has 3 or 4 properties. These items are to be converted into and array of the object, just with the 3 or 4 properties overriding the defaults in the object. Hope that helps?
Does this really answer the question of casting to a TypeScript class? What are all these undefineds, anys and pipes? No harm if they're necessary but what are they doing? Or is this something that 'just worked' for the author and they know not why?
This showed me the permissions error that had caused me to get this error message. Even though I had seen previous permissions errors at the command-line.