diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-08-24 18:47:31 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-09-02 12:04:07 -0700 |
commit | cc70cfb5024729935b5dd9be385847bd43c90b04 (patch) | |
tree | 28e860755f2a6c90a9641a5f70b125f5392848f1 /build.sbt | |
parent | 66a316a4acdb2584ef9d85f15b950f12c94d909c (diff) | |
download | scala-cc70cfb5024729935b5dd9be385847bd43c90b04.tar.gz scala-cc70cfb5024729935b5dd9be385847bd43c90b04.tar.bz2 scala-cc70cfb5024729935b5dd9be385847bd43c90b04.zip |
Simplify decision whether to derive accessors
Originally (modulo renaming & reduction of double negation in previous commit):
```
def deriveAccessors(vd: ValDef) = vd.mods.isLazy || !(
!owner.isClass
|| (vd.mods.isPrivateLocal && !vd.mods.isCaseAccessor) // this is an error -- now checking first
|| (vd.name startsWith nme.OUTER)
|| (context.unit.isJava) // pulled out to caller
|| isEnumConstant(vd)
)
def deriveAccessorTrees(vd: ValDef) = !(
(vd.mods.isPrivateLocal && !vd.mods.isLazy) // lazy was pulled out to outer disjunction
|| vd.symbol.isModuleVar // pulled out to caller
|| isEnumConstant(vd))
```
With changes in comments above, these conditions are now captured by one method.
Diffstat (limited to 'build.sbt')
0 files changed, 0 insertions, 0 deletions