Community
Participate
Working Groups
Build Identifier: I20110613-1736 In the following code Eclipse reports a "Type mismatch: cannot convert from A to B" warning for the "return a" statement: /** * @constructor */ function A(); /** * @constructor * @extends A */ function B(); /** * @param {A} a * @return {B} */ function test(a) { if (a instanceof B) return a; return null; } This is wrong because "a" can also be an instance of class "B" (which extends class A and is therefor a valid parameter for the function "test"). Eclipse should check at least simple if-instanceof-statements in the code to correctly determine the type of a variable. Reproducible: Always