diff options
author | Martin Odersky <odersky@gmail.com> | 2015-02-26 14:49:27 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-03-18 11:14:11 +0100 |
commit | 90696143b36f6ef68bf281a739dd3846908aec34 (patch) | |
tree | 50d35e4e5a31c95b54e25e8573c0341b56c763e1 /src/dotty/tools/dotc/ast/Desugar.scala | |
parent | af65672ba1020a55c36ea332f86246254680ab43 (diff) | |
download | dotty-90696143b36f6ef68bf281a739dd3846908aec34.tar.gz dotty-90696143b36f6ef68bf281a739dd3846908aec34.tar.bz2 dotty-90696143b36f6ef68bf281a739dd3846908aec34.zip |
Companion objects of abstract case classes are not functions.
They do not have a generated apply method, so cannot be functions.
Problem was unvovered when changing the definition of LazyAnnotation.
Diffstat (limited to 'src/dotty/tools/dotc/ast/Desugar.scala')
-rw-r--r-- | src/dotty/tools/dotc/ast/Desugar.scala | 5 |
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 = |