summaryrefslogtreecommitdiff
path: root/src/interactive/scala/tools/nsc
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-01-29 10:23:06 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-01-29 10:23:06 +1000
commit09f92d2b74badcdd989e9f17e60344e63b5483cf (patch)
treebc991e16497412c0c5ca291124ea9d27eb7e6069 /src/interactive/scala/tools/nsc
parentaf3881623cde655b37af77edb46b9e8c1b46b067 (diff)
parent7ba38a07916426314cc3bff6999f3992757e0b26 (diff)
downloadscala-09f92d2b74badcdd989e9f17e60344e63b5483cf.tar.gz
scala-09f92d2b74badcdd989e9f17e60344e63b5483cf.tar.bz2
scala-09f92d2b74badcdd989e9f17e60344e63b5483cf.zip
Merge commit '7ba38a0' into merge/2.11.x-to-2.12.x-20150129
Conflicts: build.number src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala src/library/scala/collection/Iterator.scala versions.properties
Diffstat (limited to 'src/interactive/scala/tools/nsc')
-rw-r--r--src/interactive/scala/tools/nsc/interactive/Global.scala19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/interactive/scala/tools/nsc/interactive/Global.scala b/src/interactive/scala/tools/nsc/interactive/Global.scala
index fdedaa600c..7d37beeca4 100644
--- a/src/interactive/scala/tools/nsc/interactive/Global.scala
+++ b/src/interactive/scala/tools/nsc/interactive/Global.scala
@@ -66,7 +66,9 @@ trait InteractiveAnalyzer extends Analyzer {
// that case the definitions that were already attributed as
// well as any default parameters of such methods need to be
// re-entered in the current scope.
- override def enterExistingSym(sym: Symbol): Context = {
+ //
+ // Tested in test/files/presentation/t8941b
+ override def enterExistingSym(sym: Symbol, tree: Tree): Context = {
if (sym != null && sym.owner.isTerm) {
enterIfNotThere(sym)
if (sym.isLazy)
@@ -74,8 +76,13 @@ trait InteractiveAnalyzer extends Analyzer {
for (defAtt <- sym.attachments.get[DefaultsOfLocalMethodAttachment])
defAtt.defaultGetters foreach enterIfNotThere
+ } else if (sym != null && sym.isClass && sym.isImplicit) {
+ val owningInfo = sym.owner.info
+ val existingDerivedSym = owningInfo.decl(sym.name.toTermName).filter(sym => sym.isSynthetic && sym.isMethod)
+ existingDerivedSym.alternatives foreach (owningInfo.decls.unlink)
+ enterImplicitWrapper(tree.asInstanceOf[ClassDef])
}
- super.enterExistingSym(sym)
+ super.enterExistingSym(sym, tree)
}
override def enterIfNotThere(sym: Symbol) {
val scope = context.scope
@@ -123,8 +130,8 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
else NullLogger
import log.logreplay
- debugLog("logger: " + log.getClass + " writing to " + (new java.io.File(logName)).getAbsolutePath)
- debugLog("classpath: "+classPath)
+ debugLog(s"logger: ${log.getClass} writing to ${(new java.io.File(logName)).getAbsolutePath}")
+ debugLog(s"classpath: $classPath")
private var curTime = System.nanoTime
private def timeStep = {
@@ -733,7 +740,7 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
}
}
- private def reloadSource(source: SourceFile) {
+ private[interactive] def reloadSource(source: SourceFile) {
val unit = new RichCompilationUnit(source)
unitOfFile(source.file) = unit
toBeRemoved -= source.file
@@ -782,7 +789,7 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
}
/** A fully attributed tree located at position `pos` */
- private def typedTreeAt(pos: Position): Tree = getUnit(pos.source) match {
+ private[interactive] def typedTreeAt(pos: Position): Tree = getUnit(pos.source) match {
case None =>
reloadSources(List(pos.source))
try typedTreeAt(pos)