diff options
-rw-r--r-- | src/dotty/tools/dotc/typer/EtaExpansion.scala | 6 | ||||
-rw-r--r-- | tests/pending/run/tcpoly_parseridioms.check | 21 | ||||
-rw-r--r-- | tests/run/tcpoly_parseridioms.scala (renamed from tests/pending/run/tcpoly_parseridioms.scala) | 2 |
3 files changed, 6 insertions, 23 deletions
diff --git a/src/dotty/tools/dotc/typer/EtaExpansion.scala b/src/dotty/tools/dotc/typer/EtaExpansion.scala index f4a1f97cd..7cbe70b47 100644 --- a/src/dotty/tools/dotc/typer/EtaExpansion.scala +++ b/src/dotty/tools/dotc/typer/EtaExpansion.scala @@ -142,7 +142,11 @@ object EtaExpansion { var ids: List[Tree] = mt.paramNames map (name => Ident(name).withPos(tree.pos)) if (mt.paramTypes.nonEmpty && mt.paramTypes.last.isRepeatedParam) ids = ids.init :+ repeated(ids.last) - val body = Apply(lifted, ids) + var body: Tree = Apply(lifted, ids) + mt.resultType match { + case rt: MethodType if !rt.isImplicit => body = PostfixOp(body, nme.WILDCARD) + case _ => + } val fn = untpd.Function(params, body) if (defs.nonEmpty) untpd.Block(defs.toList map untpd.TypedSplice, fn) else fn } diff --git a/tests/pending/run/tcpoly_parseridioms.check b/tests/pending/run/tcpoly_parseridioms.check deleted file mode 100644 index 8bd0a086d..000000000 --- a/tests/pending/run/tcpoly_parseridioms.check +++ /dev/null @@ -1,21 +0,0 @@ -tcpoly_parseridioms.scala:18: warning: match may not be exhaustive. -It would fail on the following input: ParseResult() - case Success(next, x) => b(next) match { - ^ -tcpoly_parseridioms.scala:17: warning: match may not be exhaustive. -It would fail on the following input: ParseResult() - def apply(in: Input): ParseResult[Tuple2[T, U]] = a(in) match { - ^ -tcpoly_parseridioms.scala:30: warning: match may not be exhaustive. -It would fail on the following input: ParseResult() - case Failure(_, _) => b(in) match { - ^ -tcpoly_parseridioms.scala:28: warning: match may not be exhaustive. -It would fail on the following input: ParseResult() - def apply(in: Input): ParseResult[T] = a(in) match { - ^ -tcpoly_parseridioms.scala:39: warning: match may not be exhaustive. -It would fail on the following input: ParseResult() - def apply(in: Input): ParseResult[U] = a(in) match { - ^ -Success(List(),Plus(1,2)) diff --git a/tests/pending/run/tcpoly_parseridioms.scala b/tests/run/tcpoly_parseridioms.scala index 6d541996c..e86af0caa 100644 --- a/tests/pending/run/tcpoly_parseridioms.scala +++ b/tests/run/tcpoly_parseridioms.scala @@ -108,5 +108,5 @@ trait ParserIdioms extends Parsers with Idioms { } object Test extends ParserIdioms with App { - println(expr("12".toList)) + assert(expr("12".toList).toString == "Success(List(),Plus(1,2))") } |