From 157c8dc72def0d452ef6322aaddeac023507d648 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 2 Feb 2017 09:23:56 +1100 Subject: Refactoring to make Checking not mutate denotations avoidPrivateLeaks got moved from Checking to TypeAssigner, where it fits well besides the other avoid methods. --- compiler/src/dotty/tools/dotc/typer/Namer.scala | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/typer/Namer.scala') 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) } } -- cgit v1.2.3