diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/settings/ScalaSettings.scala | 1 | ||||
-rw-r--r-- | test/files/pos/noproductN.flags | 1 | ||||
-rw-r--r-- | test/files/pos/noproductN.scala | 2 |
4 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 394192e22f..b0991a9c83 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2687,7 +2687,7 @@ self => if (mods.isCase) { val arity = if (vparamss.isEmpty || vparamss.head.isEmpty) 0 else vparamss.head.size productConstr :: serializableConstr :: { - if (arity == 0) Nil + if (arity == 0 || settings.YnoProductN.value) Nil else List( AppliedTypeTree( productConstrN(arity), diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala index 6c7c8757bd..b15f338938 100644 --- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala @@ -175,6 +175,7 @@ trait ScalaSettings extends AbsScalaSettings val YvirtClasses = false // too embryonic to even expose as a -Y //BooleanSetting ("-Yvirtual-classes", "Support virtual classes") val exposeEmptyPackage = BooleanSetting("-Yexpose-empty-package", "Internal only: expose the empty package.").internalOnly() + val YnoProductN = BooleanSetting ("-Yno-productN", "Do not add ProductN to case classes") def stop = stopAfter diff --git a/test/files/pos/noproductN.flags b/test/files/pos/noproductN.flags new file mode 100644 index 0000000000..14b05e7354 --- /dev/null +++ b/test/files/pos/noproductN.flags @@ -0,0 +1 @@ +-Yno-productN
\ No newline at end of file diff --git a/test/files/pos/noproductN.scala b/test/files/pos/noproductN.scala new file mode 100644 index 0000000000..856d960b7d --- /dev/null +++ b/test/files/pos/noproductN.scala @@ -0,0 +1,2 @@ +object Foo { type S = String } +case class Foo(x: Foo.S) { } |