aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-02-02 09:23:56 +1100
committerMartin Odersky <odersky@gmail.com>2017-02-02 09:23:56 +1100
commit157c8dc72def0d452ef6322aaddeac023507d648 (patch)
treedd1ace9b758f7a126b9b2909f5b2bc7215f09741 /compiler/src/dotty/tools/dotc/typer/Namer.scala
parentc1a37e13befe5a57ff2452e3a3470b1e0d8adb54 (diff)
downloaddotty-157c8dc72def0d452ef6322aaddeac023507d648.tar.gz
dotty-157c8dc72def0d452ef6322aaddeac023507d648.tar.bz2
dotty-157c8dc72def0d452ef6322aaddeac023507d648.zip
Refactoring to make Checking not mutate denotations
avoidPrivateLeaks got moved from Checking to TypeAssigner, where it fits well besides the other avoid methods.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Namer.scala9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala
index 068ef3e4b..6bd8f6d06 100644
--- a/compiler/src/dotty/tools/dotc/typer/Namer.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala
@@ -668,13 +668,15 @@ class Namer { typer: Typer =>
* to pick up the context at the point where the completer was created.
*/
def completeInCreationContext(denot: SymDenotation): Unit = {
+ val sym = denot.symbol
original match {
- case original: MemberDef => addAnnotations(denot.symbol, original)
+ case original: MemberDef => addAnnotations(sym, original)
case _ =>
}
addInlineInfo(denot)
- denot.info = typeSig(denot.symbol)
- Checking.checkWellFormed(denot.symbol)
+ denot.info = typeSig(sym)
+ Checking.checkWellFormed(sym)
+ denot.info = avoidPrivateLeaks(sym, sym.pos)
}
}
@@ -854,6 +856,7 @@ class Namer { typer: Typer =>
if (isDerivedValueClass(cls)) cls.setFlag(Final)
cls.setApplicableFlags(
(NoInitsInterface /: impl.body)((fs, stat) => fs & defKind(stat)))
+ cls.info = avoidPrivateLeaks(cls, cls.pos)
}
}