Skip to content

Commit 7e2d782

Browse files
author
Antonio Cunei
committed
backport of 25800,25801
1 parent 8a3e7e1 commit 7e2d782

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/compiler/scala/tools/nsc/interactive/CompilerControl.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,12 @@ trait CompilerControl { self: Global =>
187187
/** If source if not yet loaded, get an outline view with askParseEntered.
188188
* If source is loaded, wait for it to be typechecked.
189189
* In both cases, set response to parsed (and possibly typechecked) tree.
190+
* @param keepSrcLoaded If set to `true`, source file will be kept as a loaded unit afterwards.
190191
*/
191-
def askStructure(source: SourceFile, response: Response[Tree]) = {
192+
def askStructure(keepSrcLoaded: Boolean)(source: SourceFile, response: Response[Tree]) = {
192193
getUnit(source) match {
193194
case Some(_) => askLoadedTyped(source, response)
194-
case None => askParsedEntered(source, false, response)
195+
case None => askParsedEntered(source, keepSrcLoaded, response)
195196
}
196197
}
197198

src/compiler/scala/tools/nsc/symtab/Symbols.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,11 +2056,13 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
20562056
}
20572057
override def sourceModule = module
20582058
private var implicitMembersCacheValue: List[Symbol] = List()
2059-
private var implicitMembersCacheKey: Type = NoType
2059+
private var implicitMembersCacheKey1: Type = NoType
2060+
private var implicitMembersCacheKey2: ScopeEntry = null
20602061
def implicitMembers: List[Symbol] = {
20612062
val tp = info
2062-
if (implicitMembersCacheKey ne tp) {
2063-
implicitMembersCacheKey = tp
2063+
if ((implicitMembersCacheKey1 ne tp) || (implicitMembersCacheKey2 ne tp.decls.elems)) {
2064+
implicitMembersCacheKey1 = tp
2065+
implicitMembersCacheKey2 = tp.decls.elems
20642066
implicitMembersCacheValue = tp.implicitMembers
20652067
}
20662068
implicitMembersCacheValue

0 commit comments

Comments
 (0)