From 2ca36a96aee3f2e5cc9073b8970659180f839f95 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 6 Oct 2014 19:23:07 +0200 Subject: Create setters also for private vars Reason: We might need hooks for data representation transformations also for private vars. Private[this] vars in non-trait classes remain setterless. --- src/dotty/tools/dotc/ast/Desugar.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/ast/Desugar.scala') diff --git a/src/dotty/tools/dotc/ast/Desugar.scala b/src/dotty/tools/dotc/ast/Desugar.scala index d7bbdf2bb..dba3872cb 100644 --- a/src/dotty/tools/dotc/ast/Desugar.scala +++ b/src/dotty/tools/dotc/ast/Desugar.scala @@ -90,7 +90,7 @@ object desugar { def valDef(vdef: ValDef)(implicit ctx: Context): Tree = { val ValDef(mods, name, tpt, rhs) = vdef def setterNeeded = - (mods is Mutable) && ctx.owner.isClass && (!(mods is Private) || (ctx.owner is Trait)) + (mods is Mutable) && ctx.owner.isClass && (!(mods is PrivateLocal) || (ctx.owner is Trait)) if (setterNeeded) { // todo: copy of vdef as getter needed? // val getter = ValDef(mods, name, tpt, rhs) withPos vdef.pos ? -- cgit v1.2.3