Do we plan to implement getting type hints for the code with type error?

Currently, there are no type hints if your code has type error in the editor. This breaks the DX of refactoring code, because the compiler will never produce type hints as long as the type of your code is not correct. If i have just only add a single prop to a componet, i need to modify all the places which called the component first, and then i start to refactor the component itself. If i am not doing this steps, the compiler will never produce any type hints. There are many other examples not listed here. While in other languages like ts, java, go even rust and scala, their ide all support producing type hints in code with wrong type information.
I have a thought that may be we can make a cache of the user code, and watching the modified part, if a function is modified internally and it causes wrong type information, we can just replace the body of the function with assert false, then letting the compiler analyse the cache code to produce type hints(the type hints are from code with this function excluded). This thought is not mature and uncleared, talks are welcome

2 Likes