Fixes problem with getLinkPos, which sometimes failed on first try.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24465 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
odersky 2011-03-15 16:18:48 +00:00
parent 1cac2407fb
commit a79761ac74
2 changed files with 7 additions and 7 deletions

View File

@ -71,7 +71,7 @@ class Global(settings: Settings, reporter: Reporter)
SynchronizedMap[AbstractFile, RichCompilationUnit] {
override def put(key: AbstractFile, value: RichCompilationUnit) = {
val r = super.put(key, value)
if (r.isEmpty) debugLog("added uhnit for "+key)
if (r.isEmpty) debugLog("added unit for "+key)
r
}
override def remove(key: AbstractFile) = {
@ -621,6 +621,7 @@ class Global(settings: Settings, reporter: Reporter)
informIDE("getLinkPos "+sym+" "+source)
respond(response) {
val preExisting = unitOfFile isDefinedAt source.file
val originalTypeParams = sym.owner.typeParams
reloadSources(List(source))
parseAndEnter(getUnit(source).get)
val owner = sym.owner
@ -629,8 +630,8 @@ class Global(settings: Settings, reporter: Reporter)
val newsym = pre.decl(sym.name) filter { alt =>
sym.isType || {
try {
val tp1 = adaptToNewRunMap(pre.memberType(alt) onTypeError NoType)
val tp2 = adaptToNewRunMap(sym.tpe)
val tp1 = pre.memberType(alt) onTypeError NoType
val tp2 = adaptToNewRunMap(sym.tpe) substSym (originalTypeParams, owner.typeParams)
matchesType(tp1, tp2, false)
} catch {
case ex: Throwable =>
@ -857,8 +858,8 @@ class Global(settings: Settings, reporter: Reporter)
}
}
}
/** Parses and enteres given source file, stroring parse tree in response */
/** Parses and enters given source file, stroring parse tree in response */
private def getParsedEnteredNow(source: SourceFile, response: Response[Tree]) {
respond(response) {
onUnitOf(source) { unit =>

View File

@ -1180,8 +1180,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
assert(args.isEmpty)
val sym1 = sym.overridingSymbol(currentOwner.enclClass)
typedPos(tree.pos)((transformSuper(qual) DOT sym1)())
}
else {
} else {
staticCall(atPhase(phase.prev)(sym.overridingSymbol(implClass(sym.owner))))
}
} else {