diff options
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 2 | ||||
-rw-r--r-- | test/dotc/tests.scala | 2 | ||||
-rw-r--r-- | tests/neg/function-arity.scala | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 952a1073c..f1e1d9286 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -618,7 +618,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit formal.derivesFrom(pclass) && formal.baseArgTypes(pclass).corresponds(params) { (argType, param) => - param.tpt.isEmpty || isCompatible(argType, typedAheadType(param.tpt).tpe) + param.tpt.isEmpty || argType <:< typedAheadType(param.tpt).tpe } } diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index 0f6d134a5..60e9a4088 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -111,7 +111,7 @@ class tests extends CompilerTest { @Test def neg_abstractOverride() = compileFile(negDir, "abstract-override", xerrors = 2) @Test def neg_blockescapes() = compileFile(negDir, "blockescapesNeg", xerrors = 1) @Test def neg_bounds() = compileFile(negDir, "bounds", xerrors = 2) - @Test def neg_functionArity() = compileFile(negDir, "function-arity", xerrors = 5) + @Test def neg_functionArity() = compileFile(negDir, "function-arity", xerrors = 7) @Test def neg_typedapply() = compileFile(negDir, "typedapply", xerrors = 3) @Test def neg_typedIdents() = compileDir(negDir, "typedIdents", xerrors = 2) @Test def neg_assignments() = compileFile(negDir, "assignments", xerrors = 3) diff --git a/tests/neg/function-arity.scala b/tests/neg/function-arity.scala index 86fbab49f..5e0cb1058 100644 --- a/tests/neg/function-arity.scala +++ b/tests/neg/function-arity.scala @@ -22,3 +22,7 @@ object Test { def foo(a: Any => String) = () foo((a: Int, b: String) => a + b) // error: none of the overloaded alternatives of method foo match arguments (Int, Int) } +object jasonComment { + implicit def i2s(i: Int): String = i.toString + ((x: String, y: String) => 42) : (((Int, Int)) => String) // error +} |