diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Unapplies.scala | 2 | ||||
-rw-r--r-- | test/files/run/names-defaults.scala | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala b/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala index baf790eb50..67dd272d5a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala @@ -192,7 +192,7 @@ trait Unapplies extends ast.TreeDSL val cparamss = constrParamss(cdef) val flat = cparamss flatten - if (flat.isEmpty || cdef.symbol.hasAbstractFlag || (flat exists isDisallowed)) None + if (cdef.symbol.hasAbstractFlag || (flat exists isDisallowed)) None else { val tparams = cdef.tparams map copyUntypedInvariant // the parameter types have to be exactly the same as the constructor's parameter types; so it's diff --git a/test/files/run/names-defaults.scala b/test/files/run/names-defaults.scala index 4a69842650..e1bc7cbf59 100644 --- a/test/files/run/names-defaults.scala +++ b/test/files/run/names-defaults.scala @@ -392,6 +392,11 @@ object Test extends App { } println(""+ t4041._1 +", "+ t4041._2) + // #4441 + case class C4441a() + case class C4441b()() + C4441a().copy() + C4441b()().copy()() // DEFINITIONS def test1(a: Int, b: String) = println(a +": "+ b) |