Skip to content

Commit 9fbb9c9

Browse files
committed
Revert nullary function patch
Nullary functions are handled by scalac, and dotty should do the same.
1 parent 2a4d7bc commit 9fbb9c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,12 +562,12 @@ object desugar {
562562
* ==>
563563
* x$1 => x$1 match { cases }
564564
*
565-
* If `nparams` > 1, expand instead to
565+
* If `nparams` != 1, expand instead to
566566
*
567567
* (x$1, ..., x$n) => (x$0, ..., x${n-1}) match { cases }
568568
*/
569569
def makeCaseLambda(cases: List[CaseDef], nparams: Int = 1)(implicit ctx: Context) = {
570-
val params = (1 to (nparams min 1)).toList.map(makeSyntheticParameter(_))
570+
val params = (1 to nparams).toList.map(makeSyntheticParameter(_))
571571
val selector = makeTuple(params.map(p => Ident(p.name)))
572572
Function(params, Match(selector, cases))
573573
}

0 commit comments

Comments
 (0)