aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-11-16 14:51:30 +0100
committerMartin Odersky <odersky@gmail.com>2015-11-16 14:55:35 +0100
commit44d07275693ea0997b102b735db8703cbbbbfb74 (patch)
tree69c8cd7f9f862f1ccc8cb2693ef66002e6ac17e6 /src/dotty/tools/dotc/typer/Typer.scala
parenta7b95b8e40df320e8f4aee59a3e382957c88d517 (diff)
downloaddotty-44d07275693ea0997b102b735db8703cbbbbfb74.tar.gz
dotty-44d07275693ea0997b102b735db8703cbbbbfb74.tar.bz2
dotty-44d07275693ea0997b102b735db8703cbbbbfb74.zip
Generalize test to function classes
The previous test was too struct, missed cases where some arguments of the function were unbound. i583a.scala contains a test case.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index b689c8750..d54c9f731 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -1054,8 +1054,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
def typedAsFunction(tree: untpd.Tree, pt: Type)(implicit ctx: Context): Tree = {
val pt1 = if (defn.isFunctionType(pt)) pt else AnyFunctionProto
var res = typed(tree, pt1)
- if (pt1.eq(AnyFunctionProto) && !defn.isFunctionType(res.tpe)) {
- def msg = "not a function; cannot be followed by `_'"
+ if (pt1.eq(AnyFunctionProto) && !defn.isFunctionClass(res.tpe.classSymbol)) {
+ def msg = i"not a function: ${res.tpe}; cannot be followed by `_'"
if (ctx.scala2Mode) {
ctx.migrationWarning(msg, tree.pos)
res = typed(untpd.Function(Nil, untpd.TypedSplice(res)))