The second error … I don’t know, it looks right to me but I’m not in front of an IDE to try it out. Maybe try creating the Combine2LiveData instance as a {val combine: LiveData<Pair<Int, String>>} separately and see what type-inference errors you get for that?
That is a Pair type, so there is no error in IDE, but compiler gives me an error. I think this is because compiler not so smart to detect that generic type. it thinks that is a Any type. but when I specify it as Pair type, I got that warning.
Looks like the new inference enabled in the IDE by default infers types more correctly. To make the IDE/compiler behavior consistent please disable the new type inference in “Preferences | Build, Execution, Deployment | Compiler | Kotlin Compiler” in the IDE.
Can’t reproduce with your minimized example. Please try to restart the IDE. If the new type inference is turned off in the IDE and you’re not compiling the project with the compiler argument -XXLanguage:+NewInference, then there should be no inspection to remove explicit type arguments.