summaryrefslogtreecommitdiff
path: root/sources/scalac/ast
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/ast')
-rw-r--r--sources/scalac/ast/TreeGen.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/scalac/ast/TreeGen.java b/sources/scalac/ast/TreeGen.java
index 4abd940f9c..405f14d618 100644
--- a/sources/scalac/ast/TreeGen.java
+++ b/sources/scalac/ast/TreeGen.java
@@ -356,14 +356,16 @@ public class TreeGen implements Kinds, Modifiers, TypeTags {
*/
public Tree mkApplyTV(int pos, Tree fn, Type[] targs, Tree[] vargs) {
if (targs.length != 0) fn = TypeApply(pos, fn, mkTypes(pos, targs));
- return Apply(pos, fn, vargs);
+ if (vargs.length == 0 && fn.getType().isObjectType()) return fn;
+ else return Apply(pos, fn, vargs);
}
public Tree mkApplyTV(Tree fn, Type[] targs, Tree[] vargs) {
return mkApplyTV(fn.pos, fn, targs, vargs);
}
public Tree mkApplyTV(int pos, Tree fn, Tree[] targs, Tree[] vargs) {
if (targs.length != 0) fn = TypeApply(pos, fn, targs);
- return Apply(pos, fn, vargs);
+ if (vargs.length == 0 && fn.getType().isObjectType()) return fn;
+ else return Apply(pos, fn, vargs);
}
public Tree mkApplyTV(Tree fn, Tree[] targs, Tree[] vargs) {
return mkApplyTV(fn.pos, fn, targs, vargs);