Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcjaun2010-03-02 21:59:38 +0000
committercjaun2010-03-02 21:59:38 +0000
commite74c4b4395072ab0fcaf782c2fe71751dd26b5e5 (patch)
treeaf10b91903308e526065a0971991dd5342863211
parentac4b47e9114c67a45fc169b1e807289531f3c5c9 (diff)
downloadwebtools.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.java5
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) {

Back to the top