diff options
author | cjaun | 2010-03-02 21:59:38 +0000 |
---|---|---|
committer | cjaun | 2010-03-02 21:59:38 +0000 |
commit | e74c4b4395072ab0fcaf782c2fe71751dd26b5e5 (patch) | |
tree | af10b91903308e526065a0971991dd5342863211 | |
parent | ac4b47e9114c67a45fc169b1e807289531f3c5c9 (diff) | |
download | webtools.jsdt.core-e74c4b4395072ab0fcaf782c2fe71751dd26b5e5.tar.gz webtools.jsdt.core-e74c4b4395072ab0fcaf782c2fe71751dd26b5e5.tar.xz webtools.jsdt.core-e74c4b4395072ab0fcaf782c2fe71751dd26b5e5.zip |
[269094] [validation] Function return statement "cannot convert from Number to myFunc"
-rw-r--r-- | bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ReturnStatement.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ReturnStatement.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ReturnStatement.java index fb945746..50ca393a 100644 --- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ReturnStatement.java +++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ReturnStatement.java @@ -130,7 +130,7 @@ public void resolve(BlockScope scope) { return; } - MethodBinding methodBinding; + MethodBinding methodBinding = null; TypeBinding methodType = (methodScope.referenceContext instanceof AbstractMethodDeclaration) ? ((methodBinding = ((AbstractMethodDeclaration) methodScope.referenceContext).binding) == null @@ -166,7 +166,8 @@ public void resolve(BlockScope scope) { return; } - scope.problemReporter().typeMismatchError(expressionType, methodType, this.expression); + if(methodBinding != null && !methodBinding.isConstructor()) + scope.problemReporter().typeMismatchError(expressionType, methodType, this.expression); } public void traverse(ASTVisitor visitor, BlockScope scope) { |