From 81c0d3daa98db5b8b9ac46658e89436c2f609484 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Fri, 18 Dec 2015 14:14:11 -0800 Subject: [PATCH] Document ExtractAPI's handling of private members. Mention that private members are being extracted and included in the api structures but ignored in many other parts of incremental compiler. I've made a mistake of assuming that private members are ignored at api extraction time. This manifested itself as bug #2324. --- compile/interface/src/main/scala/xsbt/ExtractAPI.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compile/interface/src/main/scala/xsbt/ExtractAPI.scala b/compile/interface/src/main/scala/xsbt/ExtractAPI.scala index 7309aeeb9..2d94f5d3b 100644 --- a/compile/interface/src/main/scala/xsbt/ExtractAPI.scala +++ b/compile/interface/src/main/scala/xsbt/ExtractAPI.scala @@ -10,7 +10,7 @@ import scala.collection.mutable.{ HashMap, HashSet, ListBuffer } import xsbti.api.{ ClassLike, DefinitionType, PathComponent, SimpleType } /** - * Extracts API representation out of Symbols and Types. + * Extracts full (including private members) API representation out of Symbols and Types. * * Each compilation unit should be processed by a fresh instance of this class. * @@ -18,6 +18,12 @@ import xsbti.api.{ ClassLike, DefinitionType, PathComponent, SimpleType } * it has a call to `addInheritedDependencies` method defined in CallbackGlobal. In the future * we should refactor this code so inherited dependencies are just accumulated in a buffer and * exposed to a client that can pass them to an instance of CallbackGlobal it holds. + * + * NOTE: This class extract *full* API representation. In most of other places in the incremental compiler, + * only non-private (accessible from other compilation units) members are relevant. Other parts of the + * incremental compiler filter out private definitions before processing API structures. Check SameAPI for + * an example. + * */ class ExtractAPI[GlobalType <: CallbackGlobal](val global: GlobalType, // Tracks the source file associated with the CompilationUnit currently being processed by the API phase.