aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/Desugar.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/ast/Desugar.scala')
-rw-r--r--src/dotty/tools/dotc/ast/Desugar.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/ast/Desugar.scala b/src/dotty/tools/dotc/ast/Desugar.scala
index 60ca45f28..9bef032fe 100644
--- a/src/dotty/tools/dotc/ast/Desugar.scala
+++ b/src/dotty/tools/dotc/ast/Desugar.scala
@@ -342,7 +342,10 @@ object desugar {
val companions =
if (mods is Case) {
val parent =
- if (constrTparams.nonEmpty || constrVparamss.length > 1) anyRef
+ if (constrTparams.nonEmpty ||
+ constrVparamss.length > 1 ||
+ mods.is(Abstract) ||
+ constr.mods.is(Private)) anyRef
// todo: also use anyRef if constructor has a dependent method type (or rule that out)!
else (constrVparamss :\ classTypeRef) ((vparams, restpe) => Function(vparams map (_.tpt), restpe))
val applyMeths =